Features of ES2017

String padding

This section adds two functions to the String object: padStart & padEnd.
As their names, the purpose of those functions is to pad the start or the end of the string, so that the resulting string reaches the given length. You can pad it with specific character or string or just pad with spaces by default.

Here are the functions declaration:

- targetLength : that is the total length of the resulted string.

- padString : the string to pad the source string.

Object.values and Object.entries

This method returns all of the own properties descriptors of the specified object. An own property descriptor is one that is defined directly on the object and is not inherited from the object’s prototype. 

The obj is the source object. The possible keys for the returned descriptor objects result are configurable, enumerable, writable, get, set and value.

Trailing commas in function parameter lists and calls

Trailing commas in function parameter is the ability of the compiler not to raise an error (SyntaxError) when we add unnecessary comma in the end of the list

Async functions

The async function declaration defines an asynchronous function, which returns an AsyncFunction object. Internally, async functions work much like generators, but they are not translated to generator functions.

EcmaScript 2017

By Sofwan Abdulwahab

EcmaScript 2017

  • 154