Reputation: 10243
Why is it that an empty string evaluates to false in JavaScript. I know Douglas Crockford has spoken quite a bit about truthy and falsy in javascript but this still surprised me:
if("")
alert("you will never see this");
Anyone know what the basis of this behavior is. Is it implemented in this way according to the ECMAScript specifications? I'm curious.
Upvotes: 1
Views: 841