Vali Shah
Vali Shah
Feb 4 · 4 min read

Many of us know that there is a standard procedure for Javascript’s latest releases and a committee behind that. In this post, I will explain about who makes the final call on any new specification, what is the procedure for it, and what's new in ES2019.

The language specification that drives JavaScript is called ECMAScript. There is a team behind that called Technical Committee 39 [TC39] that reviews every specification before adopting.

Every change goes through a process with stages of maturity.

  • Stage 0: Ideas/Strawman
  • Stage 1: Proposals
  • Stage 2: Drafts
  • Stage 3: Candidates
  • Stage 4: Finished/Approved

A feature which reaches Stage 4 will most likely be part of the language specification.

Let's dive into the things which are added newly into the specification under ES2019.


Array.prototype.flat() proposed to flatten arrays recursively up to the specified depth and returns a new array.

Syntax: Array.prototype.flat(depth)
depth — Default value 1, Use Infinity to flatten all nested arrays.

const numbers = [1, 2, [3, 4, [5, 6]]];// Considers default depth of 1
[1, 2, 3, 4, [5, 6]]
// With depth of 2
[1, 2, 3, 4, 5, 6]
// Executes two flat operations
> [1, 2, 3, 4, 5, 6]
// Flattens recursively until the array contains no nested arrays
> [1, 2, 3, 4, 5, 6]

Array.prototype.flatMap() maps each element using a mapping function and flattens the result into a new array. It’s identical to the map operation followed by a flat of depth 1.

Syntax: Array.prototype.flatMap(callback)
callback: function that produces an element of the new Array.

const numbers = [1, 2, 3]; => [x * 2]);
> [[2], [4], [6]]
numbers.flatMap(x => [x * 2]);
> [2, 4, 6]


Object.fromEntries performs the reverse of Object.entries . It transforms a list of key-value pairs into an object.

Syntax: Object.fromEntries(iterable)
iterable: An iterable like Array or Map or objects implementing the iterable protocol

const records = [['name','Mathew'], ['age', 32]];const obj = Object.fromEntries(records);
> { name: 'Mathew', age: 32}
> [['name','Mathew'], ['age', 32]];

String.prototype.{trimStart, trimEnd}

trimStart() removes whitespace from the beginning of a string and trimEnd() removes whitespace from the end of a string.

const greeting = ` Hello Javascript! `;greeting.length;
> 19
greeting = greeting.trimStart();
> 'Hello Javascript! '
> 18
greeting = 'Hello World! ';greeting.length;
> 15
greeting = greeting.trimEnd();
> 'Hello World!'
> 12

Optional Catch Binding

Prior to the new specification, it was required to have an exception variable bind to a catch clause. ES2019 made it optional.

// Before
try {
} catch(error) {
// After
try {
} catch {

This feature is useful when you want to completely ignore the error. Best practice is to consider handling an error.

There are cases where you know the possible error that could trigger on operations. You can ignore the catch block handling.


The line separator (U+2028) and paragraph separator (U+2029) symbols are now allowed in string literals. Previously, these were treated as line terminators and resulted in SyntaxError exceptions.

// Produces invalid string before ES2019
// Valid in ES2019

Well-formed JSON.stringify

Instead of unpaired surrogate code points resulting in single UTF-16 code units, ES10 represents them with JSON escape sequences.

> '"�"'
> '"\\ud800"'


.toString() now returns exact slices of source code text, including whitespaces and comments.

function /* a comment */ foo () {}// Previously:
> 'function foo() {}'
^ no comment
^ no space
// Now:
> 'function /* comment */ foo () {}'


Read-only property that returns the optional description of a Symbol Object:

> "Symbol(desc)"
> "desc"
> ""
> undefined


TC39 keeps all the upcoming specifications which are in stage >1 of the process here. As a developer, It's important to keep tabs on what's happening around. There are many more exciting things coming up like static & private methods and fields in classes, Legacy RegEx, etc. Find out all the new things which are in the proposal stage here.

code = coffee + developer

This is no longer updated. Go to instead

Vali Shah

Written by

Vali Shah

Full Stack Engineer | Open Source Contributor

This is no longer updated. Go to instead

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade