I've been working on arrays and objects, but I'm still struggling with creating nested objects and arrays.
I have a particular array setup that I want to convert into a nested structure, but I'm finding it difficult. I'm not sure if it's even possible.
const info = [
{
"Date":"3/24/23",
"Course":"BASIC ENGLISH",
"Examiner":"Juan Ponce",
"Participants":"Nardo Putik",
"Examiner Approach":"3",
"Clear explanation of topics discussed":"3",
"Well organized activity from start to finish":"3"
},
{
"Date":"3/24/23",
"Course":"BASIC ENGLISH",
"Examiner":"Juan Ponce",
"Participants":"Cardo Martinez",
"Examiner Approach":"3",
"Clear explanation of topics discussed":"3",
"Well organized activity from start to finish":"3"
},
{
"Date":"3/24/23",
"Course":"BASIC ENGLISH",
"Examiner":"Juan Ponce",
"Participants":"Ippo Kazuya",
"Examiner Approach":"3",
"Clear explanation of topics discussed":"3",
"Well organized activity from start to finish":"3"
}
]
console.log(info);
Desired Output :
const data =
{
"Date" : "3/24/23",
"Course": "BASIC ENGLISH",
"Examiner" : "Juan Ponce",
"Details" :
[{
"Participants" : "Ippo Kazuya",
"Examiner Approach" : "3",
"Clear explanation of topics discussed" : "3",
"Well organized activity from start to finish" : "3"
},
{
"Participants" : "Cardo Martinez",
"Examiner Approach" : "3",
"Clear explanation of topics discussed" : "3",
"Well organized activity from start to finish" : "3"
},
{
"Participants" : "Nardo Putik",
"Examiner Approach": "3",
"Clear explanation of topics discussed" : "3",
"Well organized activity from start to finish" : "3"
}]
}