Suppose I could hardcode the following:
const data = [ { a: 0, b: 1}, {a:2,b:3},... ]
But I have the data in an array, and I would like to write something like the following:
const data = my_arr.map((element,index) => { a:element, b:index});
How does one yield this kind of object from an array map?