ECMAScript 6 (ES6) is the specification or standard followed by many programming languages like JavaScript, JScript, ActionScript, etc. The most popular programmimg language following this specification is JavaScript, That is why many people call ECMAScript 6 JavaScript 6
New features introduced in ECMAScript 6:
The let statement allows you to declare a variable with block scope
The const statement allows you to declare a constant
ES6 allows function parameters to have default values:
1 2 3 4 5 6 |
function myFunction(x, y = 10) { // y is 10 if not passed or undefined return x + y; } //will return 15 myFunction(5); |
Introduces a row of new methods like:
Array.find()
Array.findIndex()
Number.isInteger()
Number.isSafeInteger()
Introduces a row of new properties like:
EPSILON
MIN_SAFE_INTEGER
MAX_SAFE_INTEGER