nFriedly posted an interesting refresher on JavaScript boolean evaluation of non-boolean values : Logical Operators and Truthy / Falsy.
It’s worth mentioning that JavaScript evaluates empty arrays as “true”, whereas PHP evaluates them as “false”.
Everyone Loves Me
nFriedly posted an interesting refresher on JavaScript boolean evaluation of non-boolean values : Logical Operators and Truthy / Falsy.
It’s worth mentioning that JavaScript evaluates empty arrays as “true”, whereas PHP evaluates them as “false”.
Hey, thanks for the mention. That is a good thing to point out. I’m going to make a note of it in the article.
Also worth noting, while were on the subject, php evaluates “0″ as falsy, unlike javascript.