ES6 will change the way you write JS code.

Posted rsapaper

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ES6 will change the way you write JS code.相关的知识,希望对你有一定的参考价值。

https://hacks.mozilla.org/2015/04/es6-in-depth-an-introduction/

Counting to 6

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

What happened to Edition 4? An ECMAScript Edition 4 was once planned—and in fact a ton of work was done on it—but it was eventually scrapped as too ambitious. (It had, for example, a sophisticated opt-in static type system with generics and type inference.)

ES4 was contentious. When the standards committee finally stopped work on it, the committee members agreed to publish a relatively modest ES5 and then proceed to work on more substantial new features. This explicit, negotiated agreement was called “Harmony,” and it’s why the ES5 spec contains these two sentences:

ECMAScript is a vibrant language and the evolution of the language is not complete. Significant technical enhancement will continue with future editions of this specification.

This statement could be seen as something of a promise.

Promises resolved

ES5, the 2009 update to the language, introduced Object.create()Object.defineProperty()getters and settersstrict mode, and the JSONobject. I’ve used all these features, and I like what ES5 did for the language. But it would be too much to say any of these features had a dramatic impact on the way I write JS code. The most important innovation, for me, was probably the new Array methods: .map().filter(), and so on.

Well, ES6 is different. It’s the product of years of harmonious work. And it’s a treasure trove of new language and library features, the most substantial upgrade for JS ever. The new features range from welcome conveniences, like arrow functions and simple string interpolation, to brain-melting new concepts like proxies and generators.

ES6 will change the way you write JS code.

This series aims to show you how, by examining the new features ES6 offers to javascript programmers.

We’ll start with a classic “missing feature” that I’ve been eager to see in JavaScript for the better part of a decade. So join us next week for a look at ES6 iterators and the new for-of loop.

以上是关于ES6 will change the way you write JS code.的主要内容,如果未能解决你的问题,请参考以下文章

The SmSh Android App Will Change Your Life. It's Free For Now.

3 ways blockchain technology will reshape “New Retail”

理解 Python 中的逻辑(Learn Python the Hard Way 练习 27)

Architecting Android…The clean way?

未定义的方法“image_will_change!”用于 Heroku 上的 CarrierWave

How Will Java Technology Change My Life?