Preferences

What do you mean? false isn’t true in JavaScript.

Filligree
“false”, not false. So there’s odd type coercion, but the problem is that it can happen without you asking for it.

Python does the same thing. I don’t like it there either, but at least it’s more consistent about it.

nailer OP
Yes strings aren’t false unless they’re empty. Good thing.
macintux
Or, judging by other comments, “0”.
astura
The string with the value of "false" evaluates to true.

In other words

If ("false") { /* You will be here */ }

This item has no comments currently.