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…then use the model to get the options?
var cars = [ { 'makes' : 'Honda', 'models' : [ {'Accord' : ['2dr','4dr']} , {'CRV' : ['2dr','Hatchback']} , {'Pilot' : ['base','superDuper'] } ] }, { 'makes' : 'Toyota', 'models' : [ {'Prius' : ['green','reallyGreen']} , {'Camry' : ['sporty','square']} , {'Corolla' : ['cheap','superFly'] } ] } ];
Thanks
The structure:
I wrote about the traversal and everything else here.