Posts

Showing posts with the label JavaScript

Wow!!! ECMASCRIPT 2020 is here

Image
Wow!!! ECMASCRIPT 2020 is here.In this article, we’re going to review some of the latest and greatest features coming with ES2020.
ECMAScript 2020, the lates version of the official specification underlying JavaScript, was formally approval by ECMA International, and the ECMA technical committee overseeing the specification, on June 16. 
Dynamic Import If you had a file full of utility functions, some of them may rarely be used and importing all of their dependencies could just be a waste of resources. Now we can use async/await to dynamically import our dependencies when we need them
//math.js const add = (num1, num2) => num1 + num2; export { add }; //index.js const doMath = async (num1, num2) => { if (num1 && num2) { const math = await import('./math.js'); console.log(math.add(5, 10)); }; }; doMath(4, 2); BigInt and arbitrary precision integersAs you know, JavaScript has only one data type for numbers: the Number type. This primitive type allows…