How would you guys do this mapping in JavaScript?
Let's say I have an array as follows: [100,2,3,4,200,35,42,300,4,4,4,6,7,400,2] And I want to create a map, like so: { { key: 100, value: 2 }, { key: 100, value: 3 } { key: 100, value: 4 }, { key: 200,…