DEV Community

Discussion on: Top Mistakes I made as a JavaScript Developer.

Collapse
 
tyaga001 profile image
Ankur Tyagi

Because the && is a chaining operator, meaning it passes its value along until the final value is needed.

In this example the 9 is truthy, and so this is like saying true && 5 which evaluates to 5.