How would you reference the models (Accord, CRV, Prius, etc) in this structure? Is this a bad structure to be able to extract the makes...then use a make to get the models...th
You can traverse models with this code:
for (var i = 0, carslen = cars.length; i < carslen; i++) { for (var j = 0, modelslen = cars[i].models.length; j < modelslen; j++) { // do something with cars[i].models[j] } }
but I agree with Olliej about changing the structure of your JSON to his format.