JavaScript Mapping Library
It’s not easy keeping up with all the new features the ECMAScript spec brings us every year. Let’s catch up with the highlights from ES11.
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” – Google News
You must be logged in to post a comment.
This site uses Akismet to reduce spam. Learn how your comment data is processed.