d at domenic.me (2015-03-06T00:54:03.211Z)
On Tue Feb 24 2015 at 10:48:59 AM Allen Wirfs-Brock <allen at wirfs-brock.com> wrote: > or perhaps we should have Set.of(...args) and Set.from(iterable) methods. +1 Also, it occurs to me that specifying Set and Map to throw when there is greater than 1 argument would provide insurance for the comparator function argument. Sometime in the future, the operation could be relaxed to allow accepting that second argument.
On Tue Feb 24 2015 at 10:48:59 AM Allen Wirfs-Brock <allen at wirfs-brock.com> wrote: > > On Feb 24, 2015, at 5:52 AM, Axel Rauschmayer wrote: > > > I’ve accidentally created the wrong set a few times: > > > > ```js > > let set = new Set('red', 'green', 'blue'); > > // WRONG: same as new Set(['r', 'e', 'd']) > > ``` > > > > Would it make sense to throw if either of the constructors `Set` and > `Map` receives more than one argument? > > or perhaps we should have Set.of(...args) and Set.from(iterable) methods. > +1 Also, it occurs to me that specifying Set and Map to throw when there is greater than 1 argument would provide insurance for the comparator function argument. Sometime in the future, the operation could be relaxed to allow accepting that second argument. Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150224/426881d3/attachment.html>