Repozytorium Web Developera

Archiwum z lat 2013-2018, treści mogą być nieaktualne.

ECMAScript 7 / ES2016

Important note

Official ECMAScript 2016 specification only introduces method Array.prototype.includes and ** exponentiation operator.

Async functions, decorators, observables, etc. will be specified in next specifications, but for now you can use them using some preprocessing tools, like Babel or even TypeScript.

ES7/2016 official features

Array.prototype.includes


> ['a', 'b', 'c'].includes('a')
true
> ['a', 'b', 'c'].includes('d')
false

Exponentiation operator **


let squared = 3 ** 2; // 9

let num = 3;
num **= 2;
console.log(num); // 9

Useful links

Check ES8/2017 features