Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the relation between ES6, ES7 (and bigger), ES2015, stage-0, stage-1 (and bigger)?

I am lately confused between the following terms in articles about "new-ish" JavaScript:

  • ES6
  • ES7 (and sometimes, though rarely, ES8 and bigger)
  • ES2015 (and sometimes ES2016 and bigger)
  • stage-0 (and stage-1 and bigger)

It seems some of those are subset, feature-wise, of the others, but I am not quite clear on which are subsets of which.

like image 205
Karel Bílek Avatar asked Aug 22 '16 11:08

Karel Bílek


People also ask

What is the difference between ES6 and ES2015?

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.

What is ES6 and ES7?

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.

What is the difference between ES5 and ES6?

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.

What are the features of ES7?

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.


1 Answers

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.

like image 95
T.J. Crowder Avatar answered Oct 06 '22 01:10

T.J. Crowder