paint-brush
Nullish Coalescing Operator (??)by@mac
726 reads
726 reads

Nullish Coalescing Operator (??)

by Mac Wasilewski1mJanuary 23rd, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Nullish coalescing operator (??) instead of a logical or (?) is a safer operator. The OR operator will check for `falsy`. The **nullish coalesce** operator on the other hand tests for `null` and ‘undefined` only. The main purpose is to simplify assigning default values. We don’t want Javascript to do with it anything else, just return the data.

Company Mentioned

Mention Thumbnail
featured image - Nullish Coalescing Operator (??)
Mac Wasilewski HackerNoon profile picture
Mac Wasilewski

Mac Wasilewski

@mac

During the day a developer. A husband and dad at night.

About @mac
LEARN MORE ABOUT @MAC'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Mac Wasilewski HackerNoon profile picture
Mac Wasilewski@mac
During the day a developer. A husband and dad at night.

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