I don't understand the concept of ECMAScript.

Asked 1 years ago, Updated 1 years ago, 41 views

I somehow understand that it is the standard specification of javascript.
Is javascript implemented for each browser? What is the ECMAScript version of javascript running in a browser these days?

For example, this in a nested function refers to a global object, but ECMAScript5 says it has been modified.
Does that change the behavior of existing code in ECMAScript5 environment?

Professor, please.

javascript

2022-09-30 21:13

2 Answers

Most browsers, including IE9 and above, comply with ECMAScript 5.1 published in 2011, and ECMAScript 2015 published last year also works with most of the latest browsers.

ECMAScript 2015 (ECMAScript6) correspondence table
http://kangax.github.io/compat-table/es6/

In nested functions, this refers to a global object, but ECMAScript5 says it has been modified.

When this has nothing assigned to it, does it mean that the global object was set to undefined?This change is restricted to StrictMode where "use strict"; is written, thus preventing compatibility issues with older code.As mentioned earlier, most browsers today are ECMAScript 5.1 compliant, including this behavior.

Similarly, ECMAScript 2015 is designed to be highly backward compatible.When it comes to the ECMAScript 5.1 category, there is no problem with ECMAScript 2015-enabled browsers.
(Of course, this is not the case if you rely on a browser-specific implementation, but code using such features may be either a browser-to-browser compatibility issue or a countermeasure based on it.)

Related Questions:"use strict" and ECMAScript6 Relationship


2022-09-30 21:13

As can be said for HTML5 peripheral technology and CSS,
I can't say or say what version is currently being implemented in recent years.
In principle, Web technology is designed to add specifications while maintaining backward compatibility.
This means you don't have to implement and migrate the entire version all at once.
Regardless of the version, it is implemented from time to time from the technology that each browser vendor places importance.
For example, the implementation of ES2015 has not yet been completed in any browser, but the implementation of ES2016 or ES2017 proposal has already begun.
In addition, the specifications themselves are not related to the Living Standard version, and the ES core has changed to a state that is actually close to that.

Therefore, it's a good way to use it now to focus on what features are implemented, not on the version.


2022-09-30 21:13

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.