ECMAScript 2017


JavaScript Version Numbers

The older versions of ECMAScript were identified by numbers, specifically as ES5 and ES6.

Starting in 2016, the versions are labeled according to the year they are released: ES2016, 2018, 2020, and so on.

New Features in ECMAScript 2017

This section presents the latest additions in ECMAScript 2017.


JavaScript String Padding

In 2017, ECMAScript introduced two new functions for strings in JavaScript: padStart() and padEnd(). These functions help add extra characters at the start or end of a string.


JavaScript Object Entries

In 2017, ECMAScript introduced the Object.entries() method for objects.

Object.entries() gives you an array containing the key/value pairs from an object:

Object.entries() helps easily loop through objects:

Object.entries() also helps easily change objects into maps.


JavaScript Object Values

Object.values() works like Object.entries(), but it gives you an array with just the values of the object.


JavaScript Async Functions


JavaScript Trailing Commas

JavaScript permits the use of trailing commas in any list of values separated by commas.

In arrays and object basics, function actions, inputs, and sharing.

Example

function myFunc(x,,,) {};
const myArr = [1,2,3,4,,,];
const myObj = {fname: John, age:50,,,};