paint-brush
Nullish Coalescing and Optional Chaining Operatorsby@bhatVikrant
373 reads
373 reads

Nullish Coalescing and Optional Chaining Operators

by Vikrant3mSeptember 10th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

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 :)

People Mentioned

Mention Thumbnail

Coin Mentioned

Mention Thumbnail
featured image - Nullish Coalescing and Optional Chaining Operators
Vikrant HackerNoon profile picture
Vikrant

Vikrant

@bhatVikrant

L O A D I N G
. . . comments & more!

About Author

Vikrant HackerNoon profile picture
Vikrant@bhatVikrant

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Omnimd
Startupnchill