Because conditionals only care if something is zero or non-zero. Asking if any data-type is either zero or non-zero is a pretty simply and straightforward question that is easy for a programmer to understand.
Perhaps in C or C++, but I doubt that Python or other dynamic languages represent empty lists or empty strings as zeroes internally. They need runtime type information at the very least.
17
u/MisterSnuggles Mar 26 '14
While not JavaScript, we must not forget about Python's False Midnight.
tl;dr:
Prints "f".
Prints "t".