You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// // The car lot manager needs to find out how many cars are older than the year 2000. Using the carYears array you just created, find out how many cars were made before the year 2000 by populating the array oldCars and logging it's length.
96
96
letoldCars=[];
97
-
for(leti=0;i<inventory.length;i++){
98
-
oldCars[i]=inventory[i].car_year;
97
+
for(leti=0;i<carYears.length;i++){
98
+
if(carYears[i]<2000){
99
+
oldCars.push(inventory[i]);
100
+
}
101
+
99
102
}
100
-
101
-
103
+
console.log(oldCars);
102
104
103
105
// // ==== Challenge 6 ====
104
106
// // A buyer is interested in seeing only BMW and Audi cars within the inventory. Return an array that only contains BMW and Audi cars. Once you have populated the BMWAndAudi array, use JSON.stringify() to show the results of the array in the console.
0 commit comments