ES6 Tutorial

Facebooktwitterredditpinterestlinkedinmailby feather

Introduction of ES6

The ECMAScript 6 is a scripting language specification institutionalized by ECMA International. ECMA, named in 1994, is an international organization, related to information and communication system. ECMA stands for “European Computer Manufacturers Association.”

The ECMAScript grants us the advance and the basic concept of the scripting language. It helps us to develop a more readable and contemporary code. The ES6 supports various features, which provide the facility to “Write less and do more.” The specification is effected by many programming languages such as Perl, Python, self, and Java.

What is ES6?

The full name of ES6 is “ECMAScript 6” or “ECMAScript 2015.”

ES6 is also called ECMAScript 6. It is a scripting language specification that is institutionalized by ECMA international. It enables the user to work with client-side scripting languages such as Jscript, JavaScript, and ActionScript. In this tutorial, we will learn how to implement ES6 in JavaScript. The ES6 also helps us to develop server applications and services with the help of Node.js. The ES6 contains various separate implementations to standardize JavaScript. When the standards were published, the implementation of ES6 was thee most popular than other popular programming languages such as Jscript and ActionScript.   

The ECMAScript 6 allows users to write code in a more accessible manner. The ES6 concern with “write less and do more.” It means we write less code and get more output. We can use various extreme features in ES6 like arrow function, scope variable, modules, class destructions, and templates string, etc. The ES6 provides the new syntax to make the code more workable and less time-consuming.

History of ECMAScript 6 | ES6

Brendan Eich introduced a standardized specification of a scripting language, ECMAScript 6, in Netscape. Brendan Eich was an American computer scientist, inventor of JavaScript programming language, and also the co-founder of Mozilla Corporation.

In the earlier phases, the ECMAScript was known as Mocha, then LiveScript, and finally, JavaScript.  

In December 1995, an American company Sun Microsystem and Netscape, called a press conference and finally announced the name JavaScript. The Sun Microsystem was a company introduced on 24 February 1982 that sold computers, computer components, and various information technology services. The Sun Microsystem also developed the Java programming language, Solaris operating system, network file system (NFS) and SPARC, etc. 

In November 1996, theNetscape companyarranged a meeting with ECMA international standard organization to increase the standardization of JavaScript.

In June 1997, the general assembly of ECMA approved the first edition of ECMA-262. After that, various editions of this language were introduced.

The name ECMAScript is an agreement between the Netscape and Microsoft. Both organizations are associated with standardizing the language. The Brendan Eich said, “The name ECMAScript, always a rejected business name sounds like a skin disease.”

Versions of ES6

There is a total of 10 editions of ECMAScript- 262 published till June 2019. The editions are as follows-

  Edition                       Editor              Name   Modification from the previous edition  Published     Date
     1  Guy L. Steele, Jr.             The First Edition  June 1997
     2 Mike Cowlishaw   The articles changes to keep uniqueness co-ordinate with ISO/IEC 16262 international standard  June 1998
     3 Mike Cowlishaw   In the third edition, ES6 combined with proper string handling, Catch/try exception handling, regular expression, numeric output format, fast error handling, and many other modifications. December 1999
     4     The fourth edition discarded due to some political issues. Many features of ES6 discarded and included in the sixth edition of ES6. Abandoned
     5 Allen Wiefs-Brock, Pratap Laxman   In the fifth edition, ES6 was added with some strict modes. A predetermined subset that provides complete error detection and prevents error production.   Also added some features such as JSON library support, setter, and getter, object properties reflection.   Simplify the various uncertainty of the third edition contains the behavior of real-world implementation that always differs from the specification of the third edition.    December 2009
     5.1 Allen Wiefs-Brock, Pratap Laxman   The ECMAScript 6’s 5.1 edition is utterly similar to the third edition of international standard ISO/ IEC 16262:2011. June 2011
     6 Allen Wiefs-Brock ES2015 (ECMAScript 2015) In this edition, the ES6 added with various new features like arrow function expression, binary data, typed array, new collections, new style python generators, and update iterators, etc.   They also added ES6 modules, for application writing updated syntax, class declaration (declare in the same manner as ES5 mode).    June 2015
     7 Brian Terison ES2016 (ECMAScript 2016) In the 7th edition, some standard features are also included in this language such as proper tail calls, block scoping of functions and variables, exponential operators for numbers, async and await keywords for asynchronous programming, and destructuring of variables, etc. June 2016
     8 Brain Terison ES2017 (ECMAScript 2017) In the 8th edition, also added features like syntactic integration with promises, concurrency, and atomics, async and await (works with generators and promises), etc. June 2017
     9 Brain Terison ES2018 (ECMAScript 2018) In this edition, few more features are included, like asynchronous iteration, spread/rest variables, modification of regular expression, and promise. Prototype. Finally () etc. June 2018
    10 Brain Terison, Bradley Farias, Jordan Harband ES2018 (ECMAScript 2018) The 10th edition included some methods related to array features such as modification of Array.Sort(), object.from entries, Array.Prototype, flat, and Array. Prototype.flatMaps etc. June 2019

The ECMA international organization also introduced ECMA- 357 standards in June 2004. It is an extension to determine the ECMAScript, called as ECMAScript for XML(ESX). The ECMA international also introduced a profile for ECMAScript, called ECMA-372 or ES-CP.

Here we are going to discuss all the editions of ECMAScript in detail.

4th Edition of ECMA (abandoned)

The ECMA-262 (ECMAScript 4 or ES4) was the first leading update of ECMAScript. The third edition of ECMAScript was disclosed in 1999. The specification of ECMAScript with including reference implementation was intended for completion by October 2008.

The overall view of the ECMAScript was announced on 23 October 2007 by the developer group. In August 2008, the fourth edition of ECMAScript was scaled up with a project code name ECMA Harmony. Some new features discussed in the ECMA Harmony are as follows- 

  • Algebraic Datatypes
  • Generators and Iterators
  • Classes
  • The Module system
  • Destructing Assignment
  • Static typing and optional type annotation

These intent updates partly supported the better programming, and also provided the facility to improve the performance. For Example- Tamarin (A virtual machine for ActionScript developed by Adobe). The modification of new features and some bugs of ES3 were also fixed in the fourth edition.

During 2007, the debate between Brendan Eich and Chirs Wilson was public in various blogs. The fourth edition of ECMAScript was abandoned due to some political issues related to language complexity. Many features were fully dropped in this edition.

5th Edition of ECMA

Yahoo, Microsoft, Google, and other fourth edition dissenter set a name for ECMAScript 3, named ECMAScript 3.1. This edition was concentrated on library and security updates.

Both teams of ECMAScript 3.1 and ECMAScript 4 were agreed on an agreement. The two editions would be worked parallelly. They make sure that the ECMAScript 3.1 always be the subset of ECMAScript 4 in syntax and semantics.  The Branden Eich declared that ECMA TC39 would work on the ECMAScript 3.1 project with the collaboration of all teams.

In April 2009, ECMA TC39 announced that the testing of interoperable implementations of the fifth edition was expected to be completed by July. Finally, the fifth edition of ECMAScript (ECMA-262) was published on December 3, 2009.

6th Edition of ECMA

 The sixth edition of ECMAScript was initially known as ECMAScript 6 (ES6) and later named as ECMAScript 2015 in June 2015. In this new edition, ECMAScript was updated with class declaration {Class ABC (….)}, new syntax for developing complex applications, and some ES modules (import * as module_ name from “…” export const ABC;) etc.

There are also some other features included in the 6th version, like for… of loops, iterators, arrow function expression (() => {…}), Python-style generators. Const for constant variables declaration, Let for local variables declaration, typed arrays, binary data,promises, reflections, new collections(WeakMap, sets, maps), template literals for string, math, and number enhancements, proxies (metaprogramming and for virtual objects and wrappers), etc.

It is also known as ES6 Harmony, because of the first ECMA Harmony specification.

7th Edition of ECMA

The seventh edition of ECMAScript, called ECMAScript 2016, launched in June 2016. Some standard features were added in the seventh edition of ECMAScript such as destructing patterns (of variables), block scoping of variables and functions, exponential operators for numbers (**), async and await keywords for asynchronous programming and proper tail calls, etc.

8th Edition of ECMA

The 8th edition of ECMAScript, called ECMAScript 2017, launched in June 2017. In the eighth edition, ECMA updated some features like async and await constructions that work through the generators and promises. The ECMAScript 2017 also included syntactic integration with promises (async/await), concurrency, and atomics.

9th Edition of ECMA

The ninth edition of ECMAScript is also called as ECMAScript 2018, introduced in June 2018. This edition was wrapped with asynchronous operations, rest/spread operators for variables, Promise.Prototype.Pinally () method and some regular expressions etc.

10th Edition of ECMA

The tenth edition of ECMAScript was officially called ECMAScript 2019, finalized in June 2019. Some methods were added in this edition, such as Array.prototype.flatmap (), Array. prototype.map (), and some modifications in Array.sort and object.from entries.

ES.Next

ES.Next is a dynamic name concerned with the next version at the writing time. It means ES6.Next is defined as the future version of the ECMAScript programming language, but it has not been launched.

Various features have been proposed, but they are not close to the approval. Most of the developers do not try to implement any feature until they create that at stage 3. When any feature implements at stage 3, then that feature will be approved and will become part of a future version of ECMAScript.

                                         Index

Facebooktwitterredditpinterestlinkedinmailby feather