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)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay