With newly introduced Nullish Coalescing Operator we can use the double question marks operator
?? to be a bit more type strict, which only allows the default when the value is null or undefined.
Angular templates has a very cool feature: Safe Navigation of Objects. The Safe Navigation Operator is also known as the "Elvis Operator". This operator is very useful to protect against null and undefined values in property paths. This operator allows us to navigate an object path in situations when we are not aware whether a path exists or not. It returns value of the object path if it exists, else it returns the null value. It is very useful to prevent null-reference exceptions.
We can also define a BigInt with a BigInt literal. We can just attach an
n character to the end of a whole number. For example, we can write:
The only limitation with using BigInt is that all arithmetic operations can only be done with another BigInt. We can’t mix types.
Now we can use async/await to dynamically import our dependencies when we need them. Please note that Dynamic Imports will only work in a Node.js environment.
With Promise.allSettled, we can create a new promise that only returns when all of the promises passed to it are complete. This will give us access to an array with some data on each promise. This is different from Promise.all which rejects as soon as any of the passed Promise rejects.
One of the main purposes of classes is to contain our code into more reusable modules. Because you’ll create a class that’s used in many different places you may not want everything inside it to be available globally.
Now, by adding a simple hash symbol in front of our variable or function we can reserve them entirely for internal use inside the class.
That's it. These are the features I'm very excited about for ES2020. Some of these are already implemented in any evergreen browser of your choice (At least Chrome has these).