8 new JavaScript features you might have missed
Briefly

8 new JavaScript features you might have missed
"The JavaScript juggernaut never stops. There are a number of features introduced by the "living spec" every year. Then it takes some time for the browsers, Node.js, etc. to roll them in, and before you know it, there's a big pile of new JavaScript features you haven't tried. It's not too late. Here I've rounded up the ES11 (ECMAScript 11, aka ECMAScript 2020) features that you may have missed. They include a number of ergonomic and other modern improvements. Let's take a look."
"Optional chaining is one of those simple-but-effective niceties that just makes life a little easier. This feature allows you to navigate object and function chains with a shorthand for dealing with null or undefined values. Optional chaining works for simple cases like nested object data, for functions that return non-existent values, and even for functions that don't exist as member methods on objects. So you can do things like we see in Listing 1."
JavaScript continues evolving with annual additions from the living specification, producing many new language features adopted over time by browsers and Node.js. ES11 (ECMAScript 2020) delivers ergonomic improvements to everyday coding patterns. Optional chaining provides a concise shorthand to safely access nested object properties and call functions without repeatedly checking for null or undefined, returning undefined when a lookup fails. The feature applies to nested data, returned nulls from functions, and absent methods on objects. globalThis standardizes access to the global object across environments like browsers, Node.js, and web workers, improving portability.
Read at InfoWorld
Unable to calculate read time
[
|
]