Maybe add it to the forge. If you bundled it up with a collection of
useful Array utilities, it'd make it an even more attractive package. :)
On 3/06/2010 5:26 PM, Robert wrote:
Hmm,
Should I add it as a ticket to the lighthouse?
It looks like they only accept bugfixes?
On 2 Cze, 11:07, Robert<[email protected]> wrote:
I believe intersection method would be good extension to the Array
class. There is combine method (set sum) but no set intersection.
It could look like this:
Array.implement({
attest: function(item, array) {
if (!array.contains(item)) this.erase(item);
return this;
},
intersection: function(array) {
for (var i = 0, l = this.length; i< l; i++)
this.attest(this[i], array);
return this;
}
});
What You think?
--
Not sent from my Apple πPhone