diff --git a/assignments/arrays.js b/assignments/arrays.js index c007f3e99..2dababe58 100644 --- a/assignments/arrays.js +++ b/assignments/arrays.js @@ -63,34 +63,65 @@ let inventory = [{"id":1,"car_make":"Lincoln","car_model":"Navigator","car_year" // ==== Challenge 1 ==== // 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 has an id of 33 by logging the car's year, make, and model in the console log provided to you below: -console.log(`Car 33 is a *car year goes here* *car make goes here* *car model goes here*` ); +console.log("Car 33 is a "+ inventory[32]["car_year"]+" "+ inventory[32]["car_make"]+" "+inventory[32]["car_model"]); // ==== Challenge 2 ==== // 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. let lastCar = 0; -console.log(); +lastCar = inventory.length-1; +console.log("Make for the last car is "+inventory[lastCar]["car_make"]+" "+"and Model for the last car is "+inventory[lastCar]["car_model"]); + // ==== Challenge 3 ==== // 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 let carModels = []; -console.log(); + +for(let i=0; i