Here you can find the source of map(callback, thisArg)
Array.prototype.map = Array.prototype.map || (function(callback, thisArg) { var T, A, k;// w w w . j av a 2s .co m var O = Object(this); var len = O.length >>> 0; if (arguments.length > 1) T = thisArg; A = new Array(len); k = 0; while (k < len) { var kValue, mappedValue; if (k in O) { kValue = O[k]; mappedValue = callback.call(T, kValue, k, O); A[k] = mappedValue; } k++; } return A; });
Array.prototype.map = function(callback) { for(var i = 0, l = this.length; i < l; i++) { this[i] = callback(i, this[i]); return this;
Array.prototype.map = function (callback) { var mapped = []; function mutation(el) { mapped.push(callback(el)); this.each(mutation); return mapped; };
Array.prototype.map = function(callback) { var result = []; this.forEach(function(item) { result.push(callback(item)); }); return result; }; Array.prototype.concatAll = function(array) { var results = []; ...
Array.prototype.map = function(callback) { var returnArray=[]; for (var i=0; i<this.length; i++) { returnArray.push(callback(this[i])); return returnArray; };
Array.prototype.map = function(callback, thisArg){ var newArr = []; if(callback && Object.prototype.toString.call(callback) != "[object Function]"){ throw new TypeError('callback is not a function'); for(var i = 0, len = this.length; i < len; i++){ newArr[i] = callback.call(thisArg, this[i], i , this); }; return newArr; ...
Array.prototype.map = function (callbackfn, thisArg) { var res = []; for (var i=0; i<this.length; i++) res[i] = Kernel.Reflect.apply(callbackfn, thisArg, [this[i], i, this]); return res;
Array.prototype.map = function(cb){ var arr = Object(this); var res = [] for(var i=0;i<arr.length;i++){ res[i] = cb.call(arr[i], i); return res;
Array.prototype.map = function(command){ var outArray = []; this.each(function(x){ outArray.push(command(x)); }); return outArray; };
Array.prototype.map = function(f){ var newArray = []; var i; for( i = 0; i<this.length; i++){ newArray.push(f(this[i],i,this)); return newArray;