With Traceur compiler and React’s JSX, now’s the time to learn ES6
Read more from the source: tagtree.io
Chrome is toying with the idea of “use stricter” to allow significant speed improvements
Restrictions include no sparse arrays, ES6 class instances are sealed, and a few minor restrictions that have not yet been finalized.
Dr. Axel Rauschmayer summarizes:
Read more from the source: 2ality.com
Get used to backticks, ES6 introduces template strings
Read the post at 2ality.com
ECMAScript 6 promises (2/2): the API
Dr. Axel Rauschmayer from ②ality writes
This blog post is an introduction to asynchronous programming via promises in general and the ECMAScript 6 (ES6) promise API in particular. It is second in a series of two posts – part one explains foundations of asynchronous programming (which you may need to learn in order to fully understand this post).
The ECMAScript 6 promise API is easy to polyfill for ECMAScript 5.
Read the article at 2ality.com
Essentially, what you want from a polyfill delivery system is a way of sending one single copy of each of the best polyfills, in the right order (respecting dependencies), to just the browsers that lack a native implementation. The polyfill service does this by reading the User-Agent HTTP header and then using it to find the list of polyfills that are suitable for that browser and its specific version. Typically once a browser version is released, its feature set does not change until its next release.
Get started today with this one line:
Read the full article at ft.com
Watch for fat arrow syntax in ES6 along with its hard binding of the this keyword
Some notable characteristics of fat-arrow functions:
1. No prototype property and can’t be used as constructors
2. The `arguments` object is not available
3. They are always anonymous
4. `this` is hard bound to the parent scope where the function is declared
Some practical examples:
//return a new array containing the squares of the original…
[1, 2, 3, 4, 5].map(x => x * x);
//[1, 4, 9, 16, 25]
[‘caption’, ‘select’, ‘cite’, ‘article’].map(word => word.toUpperCase());
//[‘CAPTION’, ‘SELECT’, ‘CITE’, ‘ARTICLE’]