set.delete method name

Mark S. Miller erights at
Sun Feb 12 13:43:47 PST 2012

I feel strongly that "delete" is the right name for this. Currently, all
the method names (get, set, has, delete) relate directly to the names
associated with these operations when applied to properties, making them
more mnemonic.

The need to say collection['delete'](...) rather than
collection.delete(...) is only a temporary measure until the ES3 browsers
fade out enough to either 1) be ignored, or 2) be supported only as the
target of an ES5/6 -> ES3 translation. Granted this will take years. But
we'll be living with these choices for many more years after that.

On Sat, Feb 11, 2012 at 11:11 PM, Peter Michaux <petermichaux at>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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list