map.js 189 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 export default function map(arr, fn) { var res = [], i, arrLen = arr.length; for (i = 0; i < arrLen; ++i) { res.push(fn(arr[i], i)); } return res; }