Javascript Array map(handler)
Array.prototype.map = function (handler) { var result = [] for (var i = 0; i < this.length; i++) { result.push(handler(this[i]))// w ww. ja v a 2 s. com } return result }