set.add and set.delete arguments

Rick Waldron waldron.rick at gmail.com
Thu Feb 16 06:09:06 PST 2012


+1 to variable arity add() - this reminds me of Array.prototype.push

Rick

On Feb 16, 2012, at 1:56 AM, Peter Michaux <petermichaux at gmail.com> wrote:

> If add and delete take multiple arguments, the return value could be
> changed from a boolean to the number of elements added or deleted, or
> to the set of elements added or deleted?
> 
> Peter
> 
> On Wed, Feb 15, 2012 at 10:54 PM, Peter Michaux <petermichaux at gmail.com> wrote:
>> Can set.add and set.delete take multiple arguments? This would go
>> nicely with the spread of operation on an iterate that was discussed
>> for multiple arguments to the Set constructor.
>> 
>> var set0 = new Set('alpha', 'beta');
>> set0.add('gamma', 'delta');
>> var set1 = new Set('epsilon', 'zeta');
>> set0.add(...set1);
>> set0.count; // 6
>> 
>> Peter
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss


More information about the es-discuss mailing list