Welcome to ES6! New versions of JavaScript are getting closer and we will explore ECMAScript 6 new World together through a weekly series of courses. ES6 contains a number of new language features that will make JS stronger and more expressive. In the next few weeks, we'll get to know them in more detail. But before we start studying in detail, I think it's very necessary to spend a few minutes explaining what ES6 is and what you can learn from it!
What has changed in ECMAScript?
Programming language JavaScript is the implementation and extension of ECMAScript, and is being standardized by ECMA, a standard organization similar to the one. The ECMAScript defines:
- Language grammar – Syntax parsing rules, keywords, statements, declarations, operators, and so on.
- Type – Boolean, number, String, object, and so on.
- Prototypes and inheritance
- The standard library for built-in objects and functions –json, Math, array methods, object introspection methods, and so on.
The ECMAScript standard does not define the related functionality of HTML or CSS, nor does it define a Web API like the DOM (Document Object model), which is defined in a separate standard. ECMAScript covers the usage scenarios of JS in various environments, whether in a browser environment or a non-browser environment like node. js.
New Standard
Last week, the final draft of the 6th edition of the ECMAScript Language specification was brought to the ECMA Assembly for review, what does that mean?
This means we will have the latest JavaScript Core language standards this summer.
This is undoubtedly a blockbuster news. As early as 2009, the previous version of ES5 just released, since then, the ES Standards Committee has been intensively preparing the new JS language standard--ES6.
ES6 is a major version upgrade, and while ES6 is adhering to the design concept of maximizing compatibility with existing code, the JS code you wrote in the past will continue to work. In fact, many browsers already support some of the ES6 features, and will continue to work to achieve the remaining features. This means that in some browsers that have implemented some features, your JS code is already working. If you have not met any compatibility issues so far, you will most likely not encounter these problems and the browser is rapidly implementing new features.
Version Number 6
The historical versions of the ECMAScript standard are 1, 2, 3, 5, respectively.
So why is there no 4th edition? In fact, in the past there have been plans to release the 4th edition of the huge new features, but eventually because of the idea too aggressive and then be abolished (this version of the standard has an extremely complex support for generics and type inference of the built-in static type System).
ES4 was controversial, and when the standard committee finally stopped developing ES4, its members agreed to release a relatively modest version of the ES5, and then continued to develop some more substantive new features. This definitive negotiation agreement is ultimately named "Harmony", so the ES5 specification contains two words:
ECMAScript is a vibrant language and constantly evolving.
Important technical improvements will continue to be made in future versions of the specification.
This statement promises a future.
Fulfilling commitments
Improved version ES5, released in 2009, introduced Object.create (), Object.defineproperty (), getters and setters, strict mode, and JSON objects. I've used all of these new features, and I really like the improvements ES5 made. But in fact, these improvements do not affect the way I write JS code, the biggest innovation for me is probably the new array method:. Map (),. Filter () these.
However, ES6 is not so! After a few years of sharpening, it has become the most substantive JS ever upgrade, the new language and library features like the Treasure of the Lord, waiting for insight to explore. The new language features cover a wide range of popular syntactic sugars, such as arrow functions and simple string interpolation (string interpolation), to the new concept of burning the brain, such as proxies (proxies) and generators (generators).
ES6 will completely change the way you write JS code!
This series is designed to show you how to carefully review these new features that ES6 provides to JavaScript programmers.
We'll start with a classic "omission feature" that I've been looking forward to seeing in JavaScript for ten years. So join us from now on and take a look at ES6 iterators (iterators) and the new for-of loop!
Reprint: Http://www.infoq.com/cn/articles/es6-in-depth-an-introduction
ES6 (a): What is ES6?