(arr, iterator)
| 87 | } |
| 88 | |
| 89 | function _map(arr, iterator) { |
| 90 | var index = -1, |
| 91 | length = arr.length, |
| 92 | result = Array(length); |
| 93 | |
| 94 | while (++index < length) { |
| 95 | result[index] = iterator(arr[index], index, arr); |
| 96 | } |
| 97 | return result; |
| 98 | } |
| 99 | |
| 100 | function _range(count) { |
| 101 | return _map(Array(count), function (v, i) { return i; }); |