Filligree 2 days ago

“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 2 days ago

    Yes strings aren’t false unless they’re empty. Good thing.

    • macintux 2 days ago

      Or, judging by other comments, “0”.

    • [removed] 2 days ago
      [deleted]
  • [removed] 2 days ago
    [deleted]
astura 2 days ago

The string with the value of "false" evaluates to true.

In other words

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