I was thinking of
function thirdPartyLib(val) {
return val == "0";
}
thirdPartyLib(myLong); // exception
thirdPartyLib(Number(myLong)); // works
> On Jan 14, 2014, at 22:50, "Brendan Eich" <[email protected]> wrote:
>
> 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
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss