Are all non empty strings evaluated to true?
From ECMAScript:
Table 11 - ToBoolean Conversions Undefined: false Null: false Boolean: The result equals the input argument (no conversion). Number: The result is false if the argument is +0, -0, or NaN; otherwise the result is true. String: The result is false if the argument is the empty String (its length is zero); otherwise the result is true. Object: true
the answer should be yes. But then i'm wondering why:
alert(" " == false);
returns true. {same result with e.g "\t\n\r"
}
I don't have any particular use case, I'm just wondering it.