3 ms·
[] + [] === "" Elegant... hmmmmm
by tobyhinloopen 10y ago
[] + [] === ""
Elegant... hmmmmm
- ng12 10y ago[1,2,3].toString() === "1,2,3" [].toString() === "" It's only confusing to people who really don't know anything about the language.
- js-fiend 10y agothis might be a better example https://twitter.com/codinghorror/status/476826733576847360 https://twitter.com/codinghorror/status/476826733576847360
- graphememes 10y agoAre you arguing that this is confusing to you and therefore not elegant, or are you arguing that this code compiles and that means it is not elegant? Would you write that in production?