Skip to content

Commit 89ef2fc

Browse files
committed
writting the first part of challenge 3
1 parent e8eff23 commit 89ef2fc

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

‎assignments/arrays.js‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,18 @@ console.log(inventory[49]["car_make"],inventory[49]["car_model"]);
8484

8585
// ==== Challenge 3 ====
8686
// The marketing team wants the car models listed alphabetically on the website. Sort all the car model names into alphabetical order and log the results in the console
87-
let carModels = [];
88-
let carModelsSorted = [];
89-
console.log();
87+
let carModels =[] ;
88+
89+
for (let i = 0; i < inventory.length; i++){
90+
let carModels = inventory[i].car_model.push;
91+
92+
}
93+
94+
let carModelsSorted = carModels.sort();
95+
96+
97+
console.log(carModelsSorted);
98+
9099

91100
// ==== Challenge 4 ====
92101
// 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.

0 commit comments

Comments
 (0)