DEV Community

Avinashd
Avinashd

Posted on

Js in bits - 12.2(Nullish Colaescing)

Learning js should be fun. It is fun if it's easy.
I tried my best in writing this, to understand it the easy way.

?? comparison with ||

Looks like ?? and || are same, but why we need ??

Image description

Example:

Image description

Order of precedence matters!!

Image description

Without paranthesis:

Image description

Few Rules:

Image description

Leave y'r thoughts....

Top comments (0)