that's not equivalent.
d.map(i => o[i] = i\*2)
Will produce a new array on top of mutated data, o, in the parent scope. d.forEach(i => o[i] = i**2)
would be the one-to-one equivlent