I have the below set of data that is in the format of objects within an array.
const columns = [
{
"usage": 395226,
"population": 1925117,
"value": 21,
"abv": "MN"
},
{
"usage": 893129,
"population": 4327541,
"value": 21,
"abv": "IL"
}
]
I require the above set of data to be converted into below shown format. I have been stuck here for a while. I tried writing a function for converting this into the desired data format, but it didn't work.
let columns = [
["abv", "population"],
["MN", 1925117],
["IL", 4327541]
]
It would be a great help if anyone could help me solve this. Thanks in advance :)
Array.map()is not a TypeScript-specific feature. See: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…