📜 ⬆️ ⬇️

ES6 in details: introduction

ES6 in detail
Welcome to the “ES6 in Detail” series! In this weekly series of articles, we will explore ECMAScript 6, a new upcoming JavaScript language specification. ES6 has many new features that make JS more powerful and more expressive, and every week we will consider these features. But before we get going, it would be nice to talk about what ES6 is and what to expect from it.

What is ECMAScript responsible for?


The JavaScript language is standardized by the ECMA organization (like the W3C), and the standard itself is called ECMAScript. ECMAScript defines the following:


What ECMAScript does not define is all that is associated with HTML and CSS , as well as all sorts of web APIs , such as DOM . All this is determined by individual standards. ECMAScript covers those aspects of the language that are presented not only in browsers, but also in platforms like node.js.
')

New standard


A couple of weeks ago, the final version of the ECMAScript specification in the sixth edition was sent for approval to the Ecma General Assembly. What does this mean?

This means that this summer we will have a new standard for the JavaScript language.

This is big news. New JS specification does not fall from the sky every day. The latest specification, ES5, was adopted in 2009. The ES standard committee has since been working on ES6.

ES6 is a major release of the new version of the language. At the same time, your old code will continue to work. ES6 provides maximum compatibility with already written code. By the way, many browsers now support some features of ES6, and work on the implementation of other features continues. This means that all your code works in browsers with implemented parts of ES6! If you have not yet observed compatibility issues (and you have not observed them), then they will not appear in the future.

Count to 6


Previous editions of the ECMAScript standard were numbered 1, 2, 3 and 5.

What happened to the fourth edition? The ECMAScript 4 edition was planned, and a lot of work was done on it, but in the end it was abandoned as too ambitious. (For example, it had a sophisticated built-in static typing).

The fourth edition of ECMAScript was highly controversial. When the standards committee finally stopped working on it, the committee members decided to publish a relatively modest version of ES5. After that, they decided to continue working on more important new features. That is why the sixth edition of ECMAScript is called “Harmony” and contains these two sentences in the specification:

ECMAScript is a dynamic language, and its evolution has not yet ended. There will be significant technical improvements in future versions of this specification.

This statement can be considered something of a promise.

Promises fulfilled


In ES5, the 2009 update, Object.create() , Object.defineProperty() , getters and setters , strict mode and a JSON object were introduced. I used all these features, and I liked what ES5 did for the language. I have no words to describe what impact these innovations have had on how I write JS code . The most important innovation for me was the new array methods: .map() , .filter() and the like.

And ECMAScript 6 is quite different. This is the result of many years of well-coordinated work. And this is a treasure of new language features. The most significant update js that has ever been . New features range from simple conveniences like arrow functions and string interpolation to brain-breaking concepts like proxies and generators.
The goal of this series is by looking at new features to show you how ES6 will radically change your code.
We will start with features that many have been waiting for a long time - ES6 iterators and a new for-of loop. See you next week!

Source: https://habr.com/ru/post/257005/


All Articles