A rich history with a lot of back and forth which finally gained the acceptance it deserves, let’s look at how far JS has come.
Let’s retrace the steps JS took to reach where it is today:
The first version of ECMAScript came into the picture in June 1997. It was the standardized version or the first edition. The syntax was designed to intentionally resemble Java. It has a set of built-in objects that include the global object, functions arrays, string, objects, boolean numbers, math, date, RegExp, JSON. The error objects included Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError and URIError.
This came in June 1998 with some editorial updates which kept ECMA-262 synchronized with the ISO standards.
In December 1999 ECMAScript 3 added many core features which included regular expressions, better string handling, new control statements, and more.
In 2000, the team started to work on ECMAScript 4. At the same time, Microsoft rocked the market by bringing the most powerful browser and the shares reached up to 95%. This is when JScript became the standard for client-side scripting on the Web.
Now, let’s fast forward to July 2008 where ECMAScript 4 was developed & abandoned. The prototype was written in ML, but sadly TC39 could not agree on its feature set.
After that every other year a new update with minor improvements was made in the ECMAScript. In December 2009, ECMAScript5 came with features including reflective creation and inspection of objects, support for the JSON object encoding format, accessor properties, program control of property attributes, additional array manipulation functions, and a strict mode that provided enhanced error checking & program security.
When it was 2011, ECMAScript 5.1 was launched and had some minor updates corrections. This Edition was later adopted by the Ecma General Assembly, in June 2011.
From 2016 onwards, ECMAScript decided on making a yearly release. The new version introduced Array.prototype.includes(), & Exponentiation operator. Yearly releases meant there won’t be any major releases like ECMAScript.
In 2017, they added string padding, object.entries, object.values, async functions, shared memory, trailing commas in function parameter lists, and calls.
2018 included features like asynchronous iteration, rest properties, additions of RegExp, Promise.prototype.finally(), & template literal revision.
2019 came with a lot of interesting features like Array.Flat(), Array.flatMap(), Object.fromEntries(), String.trimStart() & String.trimEnd(), Optional Catch Binding, Function.toString(), Symbol.description, stability Array.Sort. It also helped in preventing JSON.Stringify() from returning to ill-formed unicode strings.
- Now for data processing & data handling, it allows developers to have much greater integer representation in their code.
- Due to BigInt, you can store integers greater than pow(2, 53) -1.
- The only thing you need to do is add an ‘n’ at the very end of the number.
- ‘n’ represents that it is a BigInt and should be treated differently by the JS engine.
- This feature allows you to access object properties that are deeply nested.
- One doesn’t have to worry whether or not the property exists.
- If the property doesn’t exist, unidentified will be returned.
- Optional chaining even works on arrays and function calls.
- Promise.allSettled is a method that accepts an array of Promises. It resolves only when all of the array of promises are settled (either resolved or rejected).
- There are times where the user wants to check whether the value is an unidentified value.
- So with nullish coalescing, you get the ability to check nullish values properly instead of falsy values.
- This is the symbol for nullish coalescing ??.
- A new method added to the String prototype is matchAll. This feature returns an iterator, which basically returns all matched groups simultaneously.
Other features include for-in order being well defined, import.meta, symmetric export syntax, globalThis & dynamic import.
ECMAScript in 2021
The new features in the latest version will include numeric separators, logical assignment operator, Promise.any(), AggregateError, finalizers, and many more features to keep us hooked. The expected release date for ECMAScript 12 is in June 2021.
Also read about: Machine Learning And It’s Future In Mobile App Development