feat: pass key to iterator

This commit is contained in:
cha0s 2020-05-22 08:42:52 -05:00
parent 0d96cb6ad5
commit 95f0dd8189

View File

@ -3,7 +3,7 @@ export function map(O, fn) {
const result = {};
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
result[key] = fn(O[key]);
result[key] = fn(O[key], key);
}
return result;
}