I am lately confused between the following terms in articles about "new-ish" JavaScript:
It seems some of those are subset, feature-wise, of the others, but I am not quite clear on which are subsets of which.
You see, ES6 and ES2015 are the same thing. ES6 was the popularized name prior to release. However, the committee that oversees ECMAScript specifications made the decision to move to annual updates. With this change, the edition was renamed to ES 2015 to reflect the year of release.
Most used Javascript ECMAScript 2015 (ES6) and ECMAScript 2016 (ES7) features. ES6 brought the most profound changes to the javascript. It completely reshaped the way we approach to javascript. ES7 was a tiny update on top of ES6. Let's see the changes that were brought in the ES6 update.
In ES5, both function and return keywords are used to define a function. An arrow function is a new feature introduced in ES6 by which we don't require the function keyword to define the function.
Array Includes Prior to ES7, the indexof() method of the Array class could be used to verify if a value exists in an array . The indexof() returns the index of the first occurrence of element in the array if the data is found ,else returns -1 if the data doesn't exist.
Fair enough, it is a bit confusing. :-)
The four-digit numbers are years, the others are specification editions.
ES2015 is ES6. It's short for ECMAScript 2015, which is the official name of the language, which is defined by the 6th edition of the specification (hence, "ES6"). From the spec:
Standard ECMA-262
6th Edition / June 2015
ECMAScript® 2015 Language Specification
Similarly, ES2016 is ES7:
Standard ECMA-262
7ᵗʰ Edition / June 2016
ECMAScript® 2016 Language Specification
2015 was the first time they put the year into the language name. The previous spec, 5.1 in 2011, was just the "ECMAScript® Language Specification". So you'll hear ES5.1 (published June 2011) ES5 (published December 2009) and ES3 (published December 1999). (There was no ES4.)
The stage-0, etc., refer to the stage of proposals to enhance the language, which are handled on this github page managed by the TC-39 committee responsible for the language. The enhancement process is laid out on this page from TC-39:
0 - Strawman
1 - Proposal
2 - Draft
3 - Candidate
4 - Finished
...and once it's at Stage 4, it'll be listed here along with the specification it's expected to be in. For instance, Async Functions have reached Stage 4 and will be in ES2017.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With