Here is an example of an array:
let heroes = [
["1", "Tony Stark"],
["2", "Steve Rogers"],
["3", "Thor"],
["4", "Nick Fury"]
];
I am looking to transform this array into an object with the following structure:
let avengers = [
{id:"1", name:"Tony Stark"},
{id:"2", name:"Steve Rogers"},
{id:"3", name:"Thor"},
{id:"4", name:"Nick Fury"}
];