1- ๐ก๐๐น๐น๐ถ๐๐ต ๐ฐ๐ผ๐ฎ๐น๐ฒ๐๐ฐ๐ถ๐ป๐ด ๐ผ๐ฝ๐ฒ๐ฟ๐ฎ๐๐ผ๐ฟ (??) accepts two operands and return the right operand if the left one is null or undefined.
console.log(false ?? 'hellooo') //false
console.log(null ?? 'hellooo') //'hellooo'
console.log(null || 'hellooo') //'hellooo'
console.log((false || null) ?? 'hellooo') // 'hellooo'
console.log(null ?? (false || 'hellooo')) // 'hellooo'
2- ๐ข๐ฝ๐๐ถ๐ผ๐ป๐ฎ๐น ๐ฐ๐ต๐ฎ๐ถ๐ป๐ถ๐ป๐ด ๐ผ๐ฝ๐ฒ๐ฟ๐ฎ๐๐ผ๐ฟ (?.) Simplify the way to access a property located deep within a chain of connected objects.
Eg: Pokemon && Pokemon.raichu
can be written as Pokemon?.raichu
3- ๐ฃ๐ฟ๐ผ๐บ๐ถ๐๐ฒ.๐ฎ๐น๐น๐ฆ๐ฒ๐๐๐น๐ฒ๐ฑ() accepts a list of promises and returns a new promise that resolves to an array of values, which were settled (either resolved or rejected) by the input promises.
4- ๐๐๐ป๐ฎ๐บ๐ถ๐ฐ ๐๐บ๐ฝ๐ผ๐ฟ๐ - The import
allows you to dynamically import a module when needed. The import() returns a Promise that will be fulfilled once the module is loaded completely.
5- ๐๐ถ๐ด๐๐ป๐ a new primitive type that can represent whole numbers bigger than
2^53 - 1
, which is the largest number Javascript can reliably represent with the Number type.
To make a BigInt, you append ๐ to the end of an integer literal.
3 + 4 + 1n // ERROR! as BigInts need to be calculated with other BigInts.
3n + 4n + 1n // 8n
3 + 4 + 1 // 8
// Both produce the value of 8, but one is a Number type, the other is a BigInt type
6- ๐ด๐น๐ผ๐ฏ๐ฎ๐น๐ง๐ต๐ถ๐ - If you write code that needs to access the global object, use different syntaxes like window, frames, self, or global.
To standardize this, ES2020 introduced the globalThis available across environments.
That's all, folks.
Happy Hustling!