What’s new in JavaScript/Node in 2021 | ECMAScript 2021

1. Promise.any

Real world use case

2. Make class Method/Accessors as private

3. Numeric Separators

1000000000   // Is this a billion? a hundred millions? Ten millions?
101475938.38 // what scale is this? what power of 10?

Use _ for separation

let budget = 1_000_000_000_000;
// What is the value of `budget`? It's 1 trillion!
// Let's confirm:
console.log(budget === 10 ** 12); // true

4. Logical Assignment Operator

When x is true assign y to x
assignment operation happens only if x is a falsy value

Logical assignment operator with ??

--

--

--

Full Stack Engineer (Web/App) working on different JS Technologies & frameworks— Angular, Node, Typescript, Ionic, Firebase, AWS, ElK...Love to write cool stuff

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Approach to Clean Architecture in Angular Applications — Hands-on

How to show Upsell’s and Cross-sell’s on Shopify Cart.

Rails React Redux Thunk User Auth with Cookies and Sessions — Part I

Persisting user authentication with Vuex in Vue

DIY Multilanguage In JavaScript Project

(Un)safe code evaluation in JavaScript

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Shivam Gupta

Shivam Gupta

Full Stack Engineer (Web/App) working on different JS Technologies & frameworks— Angular, Node, Typescript, Ionic, Firebase, AWS, ElK...Love to write cool stuff

More from Medium

Building highlighted input field in React.js

FOR OF vs. FOR IN vs. FOR EACH

Primitive values and Non-primitive values in Javascript

Learn React 18 in 5 minutes