I want to loop over each object within the object and recreate an array of object as shown below
First object
Object {
"65657-33E-2442": Object {
"description": "description qwerty",
"imageUrl": "wwxxxxzdce.jpg",
"time": "11/11/11 09:00",
"title": "title",
},
"762873-773-33838": Object {
"description": "2description qwerty2",
"imageUrl": "2wwxxxxzdce.jpg2",
"time": "22/22/22 09:00",
"title": "2title2",
},
}
I want to get a result like this :
[
{
"description": "description qwerty",
"imageUrl": "wwxxxxzdce.jpg",
"time": "11/11/11 09:00",
"title": "title",
},
{
"description": "2description qwerty2",
"imageUrl": "2wwxxxxzdce.jpg2",
"time": "22/22/22 09:00",
"title": "2title2",
},
]
#2 : this is the array that the object.values function gives me
Array [
ChildrenNode {
"children_": SortedMap {
"comparator_": [Function NAME_COMPARATOR],
"root_": LLRBNode {
"color": false,
.......
.......
My function
const getAgenda = async () => {
await getEvents().then((res) => {
console.log(res) //this return first object
console.log(Object.values(res)) //this return #2
})
}
Thanks