Here you can find the source of extract(attribute)
"use strict";//w w w .j a v a 2s .co m Array.prototype.extract = function(attribute) { var newArr = []; for (var i = 0; i < this.length; i++) { newArr.push(this[i][attribute]); } return newArr; }
Array.prototype.extract = function(field) { var newArray = []; for (var i = 0; i < this.length; i++) { if (this[i][field] != undefined) { newArray.push(this[i][field]); return newArray; }; ...
Array.prototype.extract = function(predicate) { var removed = []; if (this.length===0 || !predicate || typeof predicate !== 'function') { return removed; var idx = 0; while(idx < this.length) { if (predicate(this[idx])) { removed.push(this[idx]); ...