DEV Community

loading...

Discussion on: What does "if(variable++)" do in Javascript

Collapse
vonheikemen profile image
Heiker

Every number except 0 and NaN is considered a "truthy value". And if something is "truthy" then it pass the evaluation of the if statement.