So I have a JSON array of arrays
[ [ "2015", "Honda", "CR-V", "1.5", "Turbo 7-Seater", "Automatic" ], [ "2016", "Mazda", "CX-5", "2.0", "Premium", "Manual" ] ]
And essentially, I need to create a new JSON object using the values in the JSON array plus keys such as below:
{
"root": {
"cars": [
{
"Year": "2015",
"Make": "Honda",
"Model": "CR-V",
"Engine": "1.5",
"Submodel": "Turbo 7-Seater",
"Transmission": "Automatic"
},
{
"Year": "2016",
"Make": "Mazda",
"Model": "CX-5",
"Engine": "2.0",
"Submodel": "Premium",
"Transmission": "Manual"
}
]
}
}
I'm new to JSON and Javascript. Can anyone provide some tips and guidance? Thank you!