Out of curiosity, in the Select method, why not call the clause function once, then if the result evaluates to true, add it to the array? This would roughly double performance of select.
So, from:
for (var i = 0; i < this.items.length; i++) {
if (clause(this.items[i])) {
newArray[newArray.length] = clause(this.items[i]);
}
}
To this:
for (var i = 0; i < this.items.length; i++) {
var result = clause(this.items[i]);
if (result)
newArray[newArray.length] = result;
}
-- Curtis