Set length property

Peter Michaux petermichaux at gmail.com
Sun Feb 12 16:36:09 PST 2012


In the proposal, set objects have no length property. It is common to
want to know the length of a set.

http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets

For example, it would be good to be able to do the following.

var s = new Set();
s.add('alpha');
s.add('beta');
s.length; // 2


Peter


More information about the es-discuss mailing list