A Nullish Coalescing (in JS) Tutorial for Normal Peopleby@rahull
525 reads

A Nullish Coalescing (in JS) Tutorial for Normal People

tldt arrow
EN
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

The nullish coalescing operator (??) is a short, simple way to provide a default value when something is null or undefined. Instead of having messy nested ternaries or logical OR statements, you can use the double question mark operator to coalesce to a default. The?? operator will return the left side if it's not nullish (meaning null orefined), otherwise it will return right side.
featured image - A Nullish Coalescing (in JS) Tutorial for Normal People
a person reading the greatest book in the world via HackerNoon AI Image Generator
Rahul HackerNoon profile picture

@rahull

Rahul

18, Hustler. Code/Design.


Receive Stories from @rahull

react to story with heart

RELATED STORIES

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