Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
In JavaScript, everything is 'truthy' or 'falsy', and for numbers 0 (and NaN) means false, everything else true. So you could write:
0
false
true
if ($(selector).length)
You don't need that >0 part.
>0
In JavaScript, everything is 'truthy' or 'falsy', and for numbers 0 means false, everything else true. So you could write:
In JavaScript, everything is truthy'truthy' or falsy'falsy', and for numbers, 0 0 means falsefalse, everything else truetrue. So you could write:
and youYou don't need that > 0>0 part.
> 0>0
In JavaScript, everything is truthy or falsy and for numbers, 0 means false, everything else true. So you could write:
and you don't need that > 0 part.
> 0