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
+12-6Lines changed: 12 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -61,26 +61,32 @@ let inventory = [{"id":1,"car_make":"Lincoln","car_model":"Navigator","car_year"
61
61
// arr[i]; // 1,2,3,4
62
62
// }
63
63
64
-
//========= The dealer can't recall the information for a car with an id of 33 on his lot. Help the dealer find out which car that is by logging the car's year, make, and model in the console.
64
+
// ==== Challenge 1 ====
65
+
// The dealer can't recall the information for a car with an id of 33 on his lot. Help the dealer find out which car that is by logging the car's year, make, and model in the console.
65
66
console.log();
66
67
67
-
//========= The dealer needs the information on the last car in their inventory. What is the make and model of the last car in the inventory? Log the make and model into the console.
68
+
// ==== Challenge 2 ====
69
+
// The dealer needs the information on the last car in their inventory. What is the make and model of the last car in the inventory? Log the make and model into the console.
68
70
letlastCar=0;
69
71
console.log();
70
72
71
-
//========= 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
73
+
// ==== Challenge 3 ====
74
+
// 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
72
75
letcarModels=[];
73
76
console.log();
74
77
75
-
//========= 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.
78
+
// ==== Challenge 4 ====
79
+
// 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.
76
80
letcarYears=[];
77
81
console.log();
78
82
79
-
//========= 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.
83
+
// ==== Challenge 5 ====
84
+
// 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.
80
85
letoldCars=[];
81
86
console.log();
82
87
83
-
//========= 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.
88
+
// ==== Challenge 6 ====
89
+
// 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