Object.is() looks like a perfect function for checking oddballs (-0, NaN) if you want to represent an arbitrary data correctly. In that case distinguishing signed zeroes is a big plus (making (-0).toString() === '-0' would be better though).
 
I don't understand your use-case. If you just want to compare with NaN, Number.isNaN ain't going anywhere.
 
 
23.12.2013, 01:54, "Adam Ahmed" <[email protected]>:

If anecdotal sharing is valuable...

As a JS web developer, I'd say so. I use isNaN weekly, and have never once had to distinguish +/-0. It may be useful in some very limited cases, but for me Object.is would be much more valuable without it. Having the distinction means that in most cases I won't be able to use Object.is because I want +0 to equal -0.

On 23/12/2013 8:39 AM, "Axel Rauschmayer" <[email protected]> wrote:
We talked about this at the last last TC39 meeting. I joked about adding Object.isz, or (in honor of @izs) Object.izs.
 
;-)

But we didn't add anything. You can write it yourself, of course (just modify the Object.is polyfill).
 
My question … is: Wouldn’t `Object.is()` be more useful if it didn’t distinguish +0 and -0?

-- 
Dr. Axel Rauschmayer
 
blog: 2ality.com
 

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss
,

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to