On Tue Feb 24 2015 at 10:48:59 AM Allen Wirfs-Brock <al...@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
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss