Description

What’s new in ES2017

Async functions

Fulfilling a JavaScript Promises

async function asyncFunc() {
  return 123;
}
 
asyncFunc().then((x) => console.log(x));
// 123

Rejecting a JavaScript Promises

async function asyncFunc() {
  throw new Error("Problem!");
}
 
asyncFunc().catch((err) => console.log(err));
// Error: Problem!

Object functions

String methods

Pads the beginning of a JavaScript Strings