April 21, 2020
The TC39 committee is comprised of between 50 and about 100 different people from a broad section of web-invested companies, such as browser makers (Mozilla, Google, Apple) and device makers (Samsung, etc).
If you are interested what features are currently under review, or have just made it to the language, you can check their GitHub page.
Since one of the most recent additions to JS are optional chaining and the Coalescing Operator, let’s take a closer look at them.
Optional chaining provides a fail-safe approach when accessing object’s properties. If a property on the object does not exist, we get a very common error “Cannot read property ‘X’ of undefined”.
In order to safe guard against that error, in the past we used to use the Short-Circuit Logic with the default value provided to solve this issue (see the code snippet below in red):
However, now we can rely on the latest feature (in green).
When carousel does not exist and so the ? operator evaluates to either null or undefined, the whole expression will evaluate to undefined or thanks to the Coalescing Operator, ?? it will default to its value instead i.e. footerCarousel.slides: