5 Things You Should Know About ES8

Written by charpeni | Published 2017/07/13
Tech Story Tags: javascript | ecmascript | programming | software-development | web-development

TLDRvia the TL;DR App

ECMAScript 2017 8th edition (ES2017/ES8) has been officially released and published a few weeks ago, let’s figure it out some important changes. All of these are available with Node 8 and with the latest version of browsers without babel or any polyfills.

Here’s the specification in detail.

Object.values

Like Object.keys, but for values.

Such as **Object.keys** do, the **Object.values** method returns an array of a given object’s own enumerable property values instead of keys.

Object.entries

If we merged Object.keys and Object.values, that would be Object.entries. It returns an array of [key, value].

The **Object.entries()** method returns an array of a given object's own enumerable property [key, value] pairs.

padStart

Pad a string from the start until the given length is reached.

The **padStart()** method pads the current string with another string (repeated, if needed) so that the resulting string reaches the given length. The padding is applied from the start (left) of the current string.

padEnd

Pad a string from the end until the given length is reached.

The **padEnd()** method pads the current string with a given string (repeated, if needed) so that the resulting string reaches a given length. The padding is applied from the end (right) of the current string.

padThai

Just a delicious pad thai

Trailing commas in function parameter lists

Enjoy ES2017!


Published by HackerNoon on 2017/07/13