4 ms·
It doesn't matter in the sense that it's a case of "garbage in, garbage out". I have no idea what what `{} + 1` gives you (it's `'[object Object]1'` BTW), but w
by xdennis 4y ago
It doesn't matter in the sense that it's a case of "garbage in, garbage out". I have no idea what what `{} + 1` gives you (it's `'[object Object]1'` BTW), but whatever it is doesn't matter because it's a rubbish computation to make.
It would have made more sense to throw an exception, but JavaScript at it's origin was meant to be a simple scripting language. Nowadays with TypeScript it's much less of an issue.