Here you can find the source of select(filter)
Array.prototype.select = function(filter) { var newArr = [] for (var i = 0; i< this.length; i++) { if(filter(this[i])){ newArr.push(this[i]);//from www . j a v a2 s .com } } return newArr; }
Array.prototype.select = function(f){ var newArray = []; var temp = ''; for(var i = 0; i < this.length; i++){ temp = f(this[i]); if(temp != null || temp!= undefined){ newArray.push(temp); return newArray; };
Array.prototype.select = function (fields) { return this.map(function (i) { var res = {}; fields.forEach(function (f) { res[f] = i[f]; }); return res; }); }; ...
Array.prototype.select = function(fnCallback) { var value = Array(); for (var elementIndex in this) { if (this.hasOwnProperty(elementIndex)) { value.push(fnCallback.apply(this[elementIndex], [elementIndex])); return value; }; ...
Array.prototype.select = function(fun) { return this.reduce(function(res, el) { if(fun(el)) { res.push(el); }; return res; }, []);
Array.prototype.select = function (func) { var length = this.length, items = []; for (var i = 0; i < length; i++) { items.push(func(this[i])); return items;
Array.prototype.select = function(lambda) { if (lambda == undefined) { return this; } else { result = []; for (i = 0; i < this.length; i++) { if (lambda(this[i])) { result.push(this[i]); return result; };