domenic at domenicdenicola.com (2014-01-22T20:36:55.650Z)
I was thinking of
```js
function thirdPartyLib(val) {
return val == "0";
}
thirdPartyLib(myLong); // exception
thirdPartyLib(Number(myLong)); // works
```I was thinking of
```js
function thirdPartyLib(val) {
return val == "0";
}
thirdPartyLib(myLong); // exception
thirdPartyLib(Number(myLong)); // works
```
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" <brendan at mozilla.com> 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