set.add and set.delete arguments

Peter Michaux petermichaux at gmail.com
Wed Feb 15 22:54:29 PST 2012


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


More information about the es-discuss mailing list