Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Introduction to ES6


May 08, 2021 ES6


Table of contents


Introduction to ES6

ECMAScript 6.0 ES6 is the next-generation standard for javaScript languages and was officially released in June 2015. I ts goal is to make the JavaScript language an enterprise development language that can be used to write complex, large applications.

The relationship between ECMAScript and JavaScript

To make sense of the ECMAScript JavaScript you need to look back at history. I n November 1996, Netscape the creator of JavaScript, decided to submit JavaScript to the standardization organization ECMA in the hope that the language would become an international standard. T he following year, ECMA released the first version of Standard Document 262 (ECMA-262), which sets the standard for the browser scripting language, known as ECMAScript, which is version 1.0.

The standard was developed for the JavaScript language from the start, but it is not called JavaScript for two reasons. O ne is a trademark, Java is a trademark of Sun, and under the licensing agreement, only Netscape can legally use the name JavaScript, and JavaScript itself has been registered as a trademark by Netscape. T he second is that the person who wants to embody this language is ECMA not Netscape, which is conducive to ensuring the openness and neutrality of the language.

Therefore, the relationship between ECMAScript 规格 and JavaScript is that the former is the specification of the latter, 实现 and the latter is an implementation of the former (in addition to the ECMAScript dialect with JScript and ActionScript). O n a daily basis, the two words are interchangeable.

Relationship between ES6 and ECMAScript 2015

ECMAScript 2015 ES2015 ECMAScript 5.1 in 2011, and has been working on version 6.0 since then. T herefore, the original meaning of the word ES6 is to refer to the next version of the JavaScript language.

However, because this release introduces too many syntax features, there are many organizations and individuals in the development process who are constantly submitting new features. T hings soon became clear that it was impossible to include all the features to be introduced in one version. T he general practice is to release version 6.0 first, then version 6.1 over time, then version 6.2, version 6.3, and so on.

However, standard-seters do not want to do so. T hey want to make upgrading standards a regular process: anyone can submit proposals for new grammars to the Standards Committee at any time, and then the Standards Committee meets once a month to assess whether they are acceptable and what improvements are needed. I f, after many meetings, a proposal is mature enough to formally enter the standard. T his means that standard version upgrades become a rolling process that changes every month.

The Standards Committee ultimately decided that the standards 6月份 in June of each year as the official version of the year. T he next time, changes are made to this version, and until June of the following year, the draft will naturally become the new version of the new year. T hat way, you don't need the previous version number, just mark it with the year.

The first version 第一个 ES6, released in June 2015, is officially known as the ECMAScript 2015 Standard (ES2015). I n June 2016, the slightly revised ECMAScript 2016 Standard (ES2016) was released as scheduled, and this release can be considered version ES6.1 because the difference between the two is very small (only the index method and exponential operator for array instances have been added), which is basically the same standard. A ccording to the plan, the ES2017 standard will be released in June 2017.

Therefore, ES6 is both a historical term and a generic meaning, meaning the next generation of JavaScript after version 5.1, covering ES2015, ES2016, ES2017, and so 正式名称 ES2015 the official name, specifically the official version of the language standard released that year. W here ES6 is mentioned in this book, it generally refers to the ES2015 standard, but sometimes it also refers to the "next generation JavaScript language".

The approval process for grammar proposals

Anyone can make a proposal to the Standards Committee, also known as the TC39 Committee, for changes to language standards.

A new grammar goes through five stages from proposal to formal standard. C hanges at each stage need to be approved by the TC39 Committee.

  • -Stage 0 - Strawman (Showcase Stage)
  • -Stage 1 - Proposal (Request for Comments)
  • -Stage 2 - Draft (Draft Phase)
  • -Stage 3 - Candidate (Candidate Stage)
  • -Stage 4 - Finished (final stage)

    A proposal that enters Stage 2 certainly be included in future formal standards.

    The history of ECMAScript

    ES6 took 15 年 years from start to finish.

    As mentioned earlier, ECMAScript 1.0 was released in 1997 and ECMAScript 2.0 (June 1998) and ECMAScript 3.0 (December 1999) for the next two years. V ersion 3.0 was a huge success, widely supported in the industry and became the prevailing standard, laying down the basic syntax of the JavaScript language and fully inheriting future versions. T o this day, beginners are learning JavaScript at first, but they're actually learning version 3.0 syntax.

    EcMAScript 4.0 began brewing in 2000. T his version didn't pass in the end, but much of it was inherited by ES6. A s a result, ES6 was actually developed in 2000.

    Why didn't ES4 pass? B ecause this version is so radical, ES3 has been completely upgraded, leading some members of the standards committee to be reluctant to accept it. E CMA's Technical Committee No. 39 (TC39) is responsible for setting ECMAScript standards for large companies such as Microsoft, Mozilla, and Google.

    Draft ECMAScript 4.0 was released in October 2007 and was expected to be released in August of the next year. H owever, there were serious differences as to whether to adopt the standard. B ig companies, led by Yahoo, Microsoft and Google, oppose the big upgrade of JavaScript and advocate minor changes, while Mozilla, led by JavaScript creator Brendan Eich, sticks to the current draft.

    In July 2008, due to too much disagreement and too much debate about what features should be included in the next release, ECMA decided to suspend the development of ECMAScript 4.0, which involves a small portion of existing feature improvements, and release it as ECMAScript 3.1, while expanding other radical ideas into later versions, which, due to the atmosphere of the meeting, coden named Harmony. S hortly after the meeting, ECMAScript 3.1 was renamed ECMAScript 5.

    In December 2009, ECMAScript 5.0 was released. T he Harmony project is split in two, with some of the more viable scenarios named JavaScript.next continuing to develop and later evolving into ECMAScript 6; T he overall consideration of the TC39 committee is that ES5 is largely compatible with ES3, with larger syntax fixes and new features added, to be done by JavaScript.next. A t the time, JavaScript.next referred to ES6, and after the sixth release, ES7. T C39's judgment is that ES5 will become the mainstream standard for JavaScript development in mid-2013 and will remain in this position for the next five years.

    In June 2011, ECMAScript 5.1 was released and became an ISO international standard (ISO/IEC 16262:2011).

    In March 2013, the ECMAScript 6 draft was frozen and no new features were added. T he new feature idea will be placed in ECMAScript 7.

    In December 2013, draft ECMAScript 6 was released. T his is followed by a 12-month discussion period to hear feedback from all parties.

    In June 2015, ECMAScript 6 was officially adopted as an international standard. It's been 15 years since 2000.