I'd like to be able to push values into the associative array below.
var car = [];
car [0] = {type: "audi", age: "10"};
car [1] = {type: "bmw", age: "6"};
car [2] = {type: "tesla", age: "2"};
The method I've tried using to push is the following. Using car.length to push it into the next line of our car array, as it'll always be one higher. I don't know if that's good practice, but I guess it works.
value1 = "hyundai"
value2 = "14";
car[car.length].push({type: value1, age: value2});
I absolutely cannot get this to work, and at this point, as a beginner JS'er, I'm out of ideas.