1 /*! 2 * Wef crossBrowser 3 * Copyright (c) 2011 Pablo Escalada 4 * MIT Licensed 5 */ 6 (function (wef) { 7 8 if (!("map" in Array.prototype)) { 9 /** 10 * Crossbrowser implementation of Array.map(). 11 * 12 * More info http://stackoverflow.com/questions/2790001/fixing-javascript-array-functions-in-internet-explorer-indexof-foreach-etc 13 * </p> 14 * Copyright (c) 2010 bobince [http://stackoverflow.com/users/18936/bobince] 15 * </p> 16 * Public Domain Licensed 17 * 18 * @param {Array}mapper the source array 19 * @param [that] "this" object reference 20 */ 21 Array.prototype.map = function (mapper, that) { 22 var other, i; 23 other = new Array(this.length); 24 for (i = 0, n = this.length; i < n; i++) 25 if (i in this) 26 other[i] = mapper.call(that, this[i], i, this); 27 return other; 28 }; 29 } 30 31 })(window.wef);