Operator overloading for non-value objects

Brendan Eich brendan at mozilla.com
Tue Jan 14 19:50:02 PST 2014


Domenic Denicola wrote:
> Heh, yes, damned if you do, etc. etc. I was trying to think up a practical example where this would cause problems (e.g. in CSS libraries strings and numbers often mix), but all my cases involved an `==`-using third party library, in which case you'd just pass it `Number(myLong)` instead of `myLong` directly and move on with your life.

Wait, number works:

js> 0L == 0
true
js> 0L + 1
1L

Are you thinking of string?

/be


More information about the es-discuss mailing list