Jan 31 TC39 Meeting Notes

Allen Wirfs-Brock allen at wirfs-brock.com
Thu Feb 7 14:59:55 PST 2013


On Feb 7, 2013, at 9:41 AM, Joshua Bell wrote:

> 
> Re: Maps and Sets comparators:
> 
> On Thu, Feb 7, 2013 at 8:27 AM, Rick Waldron <waldron.rick at gmail.com> wrote:
> # January 30 2013 Meeting Notes
> 
> (snip)
>  
> 
> 
> **Conclusion/Resolution**
> - `Map( iterator = undefined, comparator = undefined )`
> - `Set( iterator = undefined, comparator = undefined )`
> 
> - If the second argument is "is", use "Object.is"
> - Otherwise, use "==="
> 
> ```js
> Map.defaultComparator( a, b )
> Set.defaultComparator( a, b )
> ```
> 
> Is that "Otherwise" clause correct, or should it be: "Otherwise, use Map/Set.defaultComparator"
> 
> ...where (based on the preceding text) the defaultComparator is like === w/r/t +/-0 but NaN's are equated?
> 
> i.e. Map.defaultComparator = function(a, b) {
>   return ((a !== a) && (b !== b)) || (a === b); 
> }
> 


It's defaultComparator that is used, not ===

Allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130207/d0a1f380/attachment-0001.html>


More information about the es-discuss mailing list