set.empty() method

Peter Michaux petermichaux at gmail.com
Tue Feb 14 21:40:54 PST 2012


If some piece of code needs to empty a set, it would be good to do
that in a single call

    set.empty();

Otherwise we might be left doing the following which could be very inefficient.

    set.forEach(function(element) {
        set['delete'](element);
    });

Peter


More information about the es-discuss mailing list