4 ms·
My favorite: x = "053" y = 50 z = "40" x > y // -> true y > z // -> true z > x // -> true
by justinpombrio 9y ago
My favorite:
x = "053"
y = 50
z = "40"
x > y
// -> true
y > z
// -> true
z > x
// -> true
- toomanybeersies 9y agoTo be fair, that's the case in Ruby and C as well, and probably other languages. It's because 0 coerces it into an octal. I actually had a bug because of this a while ago at work.