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
Copy file name to clipboardExpand all lines: assignments/arrays.js
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,10 @@ console.log(carModels.sort());
89
89
// ==== Challenge 4 ====
90
90
// The accounting team needs all the years from every car on the lot. Create a new array from the dealer data containing only the car years and log the result in the console.
91
91
letcarYears=[];
92
-
console.log();
92
+
for(leti=0;i<inventory.length;i++){
93
+
carYears.push(inventory[i].car_year);
94
+
}
95
+
console.log(carYears);
93
96
94
97
// ==== Challenge 5 ====
95
98
// 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.
0 commit comments