set.delete method name
Peter Michaux
petermichaux at gmail.com
Sat Feb 11 23:11:29 PST 2012
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
More information about the es-discuss
mailing list