What is ECMAScript?
Journey of ES
ES6 or the ECMAScript 6 that released in 2017 brought in some most advanced features to make a coder’s job easy. Most of its advances aimed to make the code more readable and reduce the burden on programmers by allowing them to code less and do more. Some of them deserve a special mention, as they went a step ahead in making coding fun and convenient. The introduction of const and let revolutionized the variable world. While both were blocked- scope, const acted as an immutable variable and let as a mutable one. The addition of arrow functions gave the code a new modern look making it more readable. Classes was another such advance that seeks to make a code more secure and encapsulated, giving an altogether fresh structure to it. Other additions included better templates, default parameters, modules and more.
Undoubtedly ES6 brought some drastic additions to its framework. It was then decided that a new version of ECMAScript would be released on an annual basis, which meant that not every version would have revolutionary changes. In the same light, ES7, that rolled out in 2016 focused on only 2 highlights- Array.prototype.includes() and Exponentiation operator. The former is an attempt to check the array for the value passed as an argument. What is common between both the highlights is the fact that ES7 did not focus on bringing about something new to the table, rather it sought to refine the existing functionalities by presenting alternatives.
ES8 rolled out in 2017 and was again home to a variety of new features and upgrades. The first feature that deserves attention is the string padding that pads a string at the start (padStart) and end (padEnd) to ensure that the string reaches the given length. Trailing commas in function parameter lists and calls serve as another mechanism for making coding convenient. As an ability of the compiler, it prevents the raising of an error on the addition of an unnecessary comma. Plenty of other additions also came along with this new version.
What’s new in ES 2018
The latest version of ECMAScript comes out as ES9. The features to be rolled with this version were decided in the TC39 Meeting and were implemented subsequently. If you are as excited as us about the new features, we won’t keep you waiting-
Definitely, the top in every list labelling the new in ES2018 is the asynchronous iteration. This feature brings along asynchronous iterators and iterables. What this makes possible is a for- wait- of iteration statement to create asynchronous generator functions and methods.
RegExp has come in ES 2018 in a total of 4 feature sets. First, s (dotAll) flag for regular expressions seeks to ensure consistent behaviour. Second, RegExp named capture groups to assist in the identification of capture groups to ensure that RegExp is easier to understand. Third, RegExp Lookbehind Assertions are zero width assertions that match a string without any consumption to fix a shortcoming. Fourth RegExp Unicode Property Escapes provides programmers with a more effective way to access Unicode character properties.
Another sought after feature addition to ES 2018, the Promise.prototype.finally() is making quite the mark. This functionality allows the programmers to register a call back to be invoked when a promise is settled. Invariably it finalizes the whole promises implementation.
Template Literals Tweak
One of the final, what’s new in ES 2018 is the template literals tweak. This was something that most developers were looking forward to. Simply put, this has brought about an elimination of all syntactic restrictions related to escape sequences in template literals.
In conclusion, it is a unanimous agreement among more developers that ES 2018 is something that they had been looking forward to. It not only promised some real upgrades and improvements to the existing functionalities, but also some major additions. The improvements and additions together have made this version a delight for most developers to work with. The ECMAScript legacy of rolling out a new version every year is definitely a boon to many. Undoubtedly, It brings along advancements that make coding modern, structured and something that programmers can look forward to.
This may be it for what’s new in ES 2018. But aren’t you already looking forward to the next version in the coming year, ES 2019? Why not make a list of what features you would like to see and then compare how close was your speculation to the real thing?