Within my code, there is an object named 'times' which contains another object labeled '20102'. This inner object has a collection of three sub-objects structured like so:
times: {
20102: [
{ name:'jane', age:12 },
{ name:'josh', age:19 },
{ name:'jill', age:14 },
]
}
However, I am seeking to restructure it to appear as follows:
times:[
{ name:'jane', age:12 },
{ name:'josh', age:19 },
{ name:'jill', age:14},
]
My initial thought was to implement a double for loop, but I realize that approach may not be the most efficient. Are there better alternatives?