DEV Community

Cover image for Nibbles: nullish coalescing
Andrew Bone
Andrew Bone

Posted on

Nibbles: nullish coalescing

The nullish coalescing operator is a logical operator similar to the logical OR operator. The operator will return what is on it's right hand side when the left hand side is nullish, (null or undefined).


const output = leftExpr ?? rightExpr;
Enter fullscreen mode Exit fullscreen mode



Current support is all major browsers except IE.

Further reading:

nullish coalescing operator
logical OR operator

Top comments (0)