set.delete method name

Oliver Hunt oliver at
Sun Feb 12 13:50:03 PST 2012

Are the Set, Map, etc types going to be implemented in any engine that doesn't already have ES5 unreserved property name semantics?

Or are we talking about implementing shims in non-ES6 engines (and so possibly ES<5)?


On Feb 12, 2012, at 1:46 PM, Brendan Eich wrote:

> Agreed, my "remove is the best all-around name" was biased toward the past. We can hang tough. This isn't a huge hardship. Indeed way back in 1996 when Nick Thompson and I connected JS and Java at Netscape, some Java APIs required, e.g. file['delete']() instead of file.delete(). I wish I had not reserved property names in '95. Fixed in ES5!
> /be
> Mark S. Miller wrote:
>> 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 <mailto: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 <mailto:es-discuss at>
>> -- 
>>    Cheers,
>>    --MarkM
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at
> _______________________________________________
> es-discuss mailing list
> es-discuss at

More information about the es-discuss mailing list