5.4.1. ECMAScript¶
5.4.1.1. Introduction¶
ECMAScript is a scripting programming language standardized by ECMA International through ECMA-262, and it is often referred to as JavaScript or JScript. Simply, ECMAScript can be considered a standard of JavaScript, but in fact the latter two are implementations and extensions of the ECMA-262 standard.
5.4.1.2. Version¶
In June 1997, the first edition was released. In June 1998, the format was revised to make its form consistent with the ISO/IEC16262 international standard. In December 1999, powerful regular expressions were introduced, better lexical scope chain handling, new control instructions, exception handling, better definition of errors, formatting of data output, and other changes. Version 4 was then abandoned due to disagreements about the complexity of the language, and parts of it became the basis for Version 5 and Harmony.
In December 2009, the fifth edition was released with the addition of “strict mode”, which clarified many of the vague specifications of the third edition and accommodated the behavior of real-world implementations that were inconsistent with the specification. Added some new features like getters and setters, JSON support and more complete reflection on object properties.
In June 2015, version 6 was released, originally known as ECMAScript 6 (ES6), adding class and module syntax, iterators, Python-style generators and generator expressions, arrow functions, binary data, static Types arrays, collections (maps, sets and weak maps), promises, reflections and proxies.
In June 2016, ECMAScript 2016 (ES2016) was released, introducing Array.prototype.includes
new features such as, exponential operator, SIMD, etc.
In June 2017, ECMAScript 2017 (ES2017) was released with several new concepts and language features.
In June 2018, ECMAScript 2018 (ES2018) was released with asynchronous loops, generators, new regular expression features and rest/spread syntax.
5.4.1.3. ES6 Features¶
const
/let
template literal
- deconstruct
[a, b] = [10, 20]
Object literal shorthand
for...of
cycle...xxx
spread operatorvariable parameter
arrow function
Default parameter function
Defaults and Destructuring
class