DEV Community

Manu Krishnan
Manu Krishnan

Posted on

2 1

JS tips - Operator which can detect null and undefined but no other falsy values like zero,false, empty string in javascript

In one word its a very simple solution, i.e. Nullish coalescing operator (??)

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

DEV shines when you're signed in, unlocking a customized experience with features like dark mode!

Okay