set.delete method name

Andrea Giammarchi andrea.giammarchi at gmail.com
Sun Feb 12 04:24:16 PST 2012


+1

had same thoughts when I wrote this:
https://github.com/WebReflection/es6-collections

then I have realized older IE compatibility requires the usage of the
string but I would have rather suggested

del

instead of remove so get, set, has, del ... all 3 chars, no problems with
reserved keywords

br



On Sun, Feb 12, 2012 at 8:11 AM, Peter Michaux <petermichaux at gmail.com>wrote:

> The Set proposal has a "delete" method. Old ECMAScript implementations
> do not allow "delete" to appear as a bare method name like
> set.delete('foo') and it is necessary to write the awkward
> set['delete']('foo'). Because of this and knowing polyfills will be
> written to support Set in older implementations, would it be better to
> choose "remove" as the method name so that set.remove('foo') can be
> written in the older implementations? I think this would save a lot of
> unnecessary debugging for cross-browser programming.
>
> Peter
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120212/05357f1d/attachment.html>


More information about the es-discuss mailing list