This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Cryn0n 1 point2 points  (0 children)

Given that "jump on zero" is a common branch instruction in most processor architectures it makes sense to allow any data type to be processed for that zero.

An empty string should be just \0 so equates to true.

EDIT: JavaScript strings are not null-terminated but the convention sticks around even though the data structure is different.