Member-only story
JavaScript ES2018 Features With Examples
ES2018 a.k.a. ES9 features
Today, we’re going to look at ECMAScript features from 2015:
- ES2015 a.k.a. ES6
- ES2016 a.k.a. ES7
- ES2017 a.k.a. ES8
- ES2018 a.k.a. ES9
- ES2019 a.k.a. ES10
- ES2020 a.k.a. ES11
Introduction
ES2018, a.k.a. ES9, is the version of ECMAScript corresponding to the year 2018. This version does not include as many new features as those that appeared in ES6 (2015). However, some useful features have been incorporated.
This article introduces the features provided by ES2018 in easy code examples. In this way, you can quickly understand the new features without the need for a complex explanation.
Of course, it is necessary to have a basic knowledge of JavaScript to fully understand the best ones introduced.
The new JavaScript features in ES2018 are:
- Lifting template literal restriction.
s (dotAll)flag for regular expressions.- Regexp named capture groups.
- Rest/spread properties.
- Regexp lookbehind assertions.
- Regexp Unicode property escapes.
Promise.prototype.finally.- Asynchronous iteration.
Lifting Template Literal Restriction
The proposed solution is to set the cooked value to undefined for template values that contain illegal escape sequences.
The raw value is still accessible via .raw so embedded DSLs that might contain undefined cooked values can just use the raw string:
s (dotAll) Flag for Regular Expressions
Currently, the dot (.) in regular expressions doesn't match line terminator characters (before ES2018). The proposal specifies the regular expression flag /s.

