|
|
|
|
|
by prodigal_erik
5085 days ago
|
|
Javascript's maze of type coercion rules produce results which manage to be frequently wrong but in ever more bewildering ways only slightly less crackheaded than PHP. It's also saddled with Java's inexcusable "everything is an object, except for all the crap that isn't" philosophy. http://wtfjs.com/ is a growing list, but a few of my favorites: [] != []
[] == ![]
{} + [] is 0
[] + {} is "[object Object]"
{} + {} is NaN
|
|