Skip to content

Commit 59245f9

Browse files
committed
Solved challenge 2 be using a string template litteral a indexing stored inside a variable
1 parent ae96f4e commit 59245f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

assignments/arrays.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ console.log(`Car 33 is a ${inventory[32].car_year} ${inventory[32].car_make} ${i
6969

7070
// ==== Challenge 2 ====
7171
// 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.
72-
let lastCar = 0;
73-
console.log();
72+
let lastCar = `The last car is a ${inventory[49].car_year} ${inventory[49].car_make} ${inventory[49].car_model}`;
73+
console.log(lastCar);
7474

7575
// ==== Challenge 3 ====
7676
// 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

0 commit comments

Comments
 (0)