I am fetching an API endpoint which returns data in the format
{
"0": {
"name": "Rohan"
},
"1": {
"name": "Meghan"
},
"2": {
"name": "Rita"
}
}
But since it is not array my map function throws an error
Home.jsx:39 Uncaught TypeError: users.map is not a function
Hence I want to convert this object of objects into a const arrOfarr
. The array should look like:
[
{
"name": "Rohan"
},
{
"name": "Meghan"
},
{
"name": "Rita"
}
]