2 ms·
In most dynamic languages 0 is false and anything else is true but it normally wouldn't use that information to coerce two values of different types to booleans
by spullara 16y ago
In most dynamic languages 0 is false and anything else is true but it normally wouldn't use that information to coerce two values of different types to booleans before comparing them.
- mnutt 16y agoI'm only aware of php and javascript equating 0 to false. But at any rate in this case it's not equating 0 to false, it's comparing non-zero to zero and returning true. (as it should)
- burgerbrain 16y agoIn C, 0 evaluates to false.