(input, fn)
| 89 | } |
| 90 | |
| 91 | function map(input, fn) { |
| 92 | let length = input.length, |
| 93 | result = new Array(length), |
| 94 | i |
| 95 | for (i = 0; i < length; i++) { |
| 96 | result[i] = fn(input[i]) |
| 97 | } |
| 98 | return result |
| 99 | } |
| 100 | |
| 101 | function forEach(arr, fn) { |
| 102 | let length = arr.length, |