TL;DR —
The most common use-case is accessing a value from a nested Object in javascript. Nullish Coalescing and Optional Chaining Operators can make your life easier. The (??) operator is a logical operator that returns its right-hand side operand when its left-hand operand is null or undefined. The optional chaining operator? permits reading the value of a property located deep within a chain of connected objects without having to validate that each reference in the chain is valid. Let's see some use-cases that you might encounter frequently, where the (?? ) operator can make life easier :)
[story continues]
Written by
@bhatVikrant
Technical Writer on HackerNoon.
Topics and
tags
tags
es2020|javascript|techniques|reactjs|web-development|tutorial|beginners-guide|working-example
This story on HackerNoon has a decentralized backup on Sia.
Transaction ID: IBppon2d2TbbMf9lru0hVt1fZpya7En6qpnVGV6UZsk
