What’s new in JavaScript? ES2017 Language Features

The ECMAScript 2017 Language Specification – the 8th edition of the spec – was officially released at the end of June by TC39.

💁‍♂️ ICYWW: Should we say ES2017 or ES8?

→ Say ES2017. Back in the day ES6 was (and still is) used a lot to refer to ES2015, but one should be referring to the standard using the year references (or refer to a language feature using its name)

One of the top additions – which I’ve been using for quite a while now thanks to babel-polyfill and its included core-js – is Object.entries()/Object.values(), as they have rather big effect on the way I write my code.

const obj = { x: 'xxx', y: 1 };
Object.values(obj); // ['xxx', 1]

const obj = { x: 'xxx’, y: 1 };
Object.entries(obj); // [[’x’, 'xxx’], [’y’, 1]]

As it’s an array, one can easily append a .forEach(…) to each one of these beauties to get going … And don’t forget about map/reduce/filter either 😉

Async functions is also at the top of my list of influential features:

function fetchTextByPromise() {
  return new Promise(resolve => { 
    setTimeout(() => { 
      resolve("ES2017");
    }, 2000);
  });
}

async function sayHello() { 
  const externalFetchedText = await fetchTextByPromise();
  console.log(`Hello, ${externalFetchedText}`); // Hello, ES2017
}
sayHello();

Furthermore some new string padding functions, Object.getOwnPropertyDescriptors(obj), “Trailing commas in function parameter lists and calls”, and “Shared memory and atomics” has been added.

ES8 was Released and here are its Main New Features →
ECMAScript 2017 Language Specification (PDF) →

Did this help you out? Like what you see?
Consider donating.

I don’t run ads on my blog nor do I do this for profit. A donation however would always put a smile on my face though. Thanks!

☕️ Buy me a Coffee ($3)

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Unless noted otherwise, the contents of this post are licensed under the Creative Commons Attribution 4.0 License and code samples are licensed under the MIT License

Join the Conversation

3 Comments

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.