how do I convert an array to array of objects with the key being the same as value?
var abc = ["abc", "def"];
var sed = abc.map(function(a, index) {
return {
a: a,
key: a
}
})
console.log(sed);
My output should look like
[{
abc: "abc",
key: "abc"
},
{
def: "def",
key: "def"
}
]