Skip to content

Commit 49dd2f0

Browse files
sofialevinsofialevin
authored andcommitted
Completed Challenge 4 in arrays.js file.
1 parent b750084 commit 49dd2f0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎assignments/arrays.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,12 @@ 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+
93+
for (let i = 0; i < inventory.length; i++) {
94+
carYears.push(inventory[i]['car_year']);
95+
}
96+
97+
console.log(carYears);
9398

9499
// ==== Challenge 5 ====
95100
// 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)