I'm looking for a way to create an object that contains a summary with all the existing parameters in each item of the array. sample tel arrangement:
const peopleArray = [
{ id: 123, name: "dave", age: 23 , ar: [{id:1},2,3]},
{ id: 456, name: "chris", age: 23 },
{ id: 789, name: "bob", age: 23 },
{ id: 123, name: "dave", age: 23 , ar: [{ir:1},2,3]},
]
exit
{ "age": 23,
"id": 102,
"name":"chris"
"tim",
"ar": [{
"id": 1,
"ir": 1
},
2,3
]
}
The important thing for me is to be able to get all the keys at the same level that was found, use the function array.reduce, but I do not get all the parameters.
Why am I looking to do this? I have an arrangement with 100 items, each item has certain parameters that I want to add, so I want to make 1 object that has all the keys and the total of each one.