Skip to content

Commit 755dc64

Browse files
author
Gill Abada
committed
Completed arrays.js challenges 4.
1 parent f08c0d3 commit 755dc64

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

assignments/arrays.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ console.log(carModels.sort());
8989
// ==== Challenge 4 ====
9090
// 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.
9191
let carYears = [];
92-
console.log();
92+
for (let i = 0; i < inventory.length; i++) {
93+
carYears.push(inventory[i].car_year);
94+
}
95+
console.log(carYears);
9396

9497
// ==== Challenge 5 ====
9598
// 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

Comments
 (0)