New Set.iterateLocal method

This commit is contained in:
Richard Davey 2017-11-09 04:00:33 +00:00
parent 3bbe07afb1
commit 390dcbf461

View file

@ -133,6 +133,28 @@ var Set = new Class({
return this;
},
iterateLocal: function (callbackKey)
{
var i;
var args = [];
for (i = 1; i < arguments.length; i++)
{
args.push(arguments[i]);
}
var len = this.entries.length;
for (i = 0; i < len; i++)
{
var entry = this.entries[i];
entry[callbackKey].apply(entry, args);
}
return this;
},
clear: function ()
{
this.entries.length = 0;