Javascript Create Map From Array Javascript Iteration