Skip to content

Fred Sohn#158

Open
fron12 wants to merge 4 commits intobloominstituteoftechnology:masterfrom
fron12:master
Open

Fred Sohn#158
fron12 wants to merge 4 commits intobloominstituteoftechnology:masterfrom
fron12:master

Conversation

@fron12
Copy link

@fron12 fron12 commented Jun 25, 2018

No description provided.

// 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[33].car_year + ` ` + inventory[33].car_make + ` ` + inventory[33].car_model);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're on the right track here Fred! But remember that the starting index of an array is 0, not 1. So what this is actually currently pointing to is the car with an ID of 34, because you're pointing to its index, not its ID.

let lastCar = 0;
console.log();
let lastCar = 50;
console.log(`Car ` + inventory[lastCar -1].id + ` is a ` + inventory[lastCar - 1].car_year + ` ` + inventory[lastCar - 1].car_make + ` ` + inventory[lastCar - 1].car_model);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just minor but something to keep in mind as a good coding practice is consistency in spacing.

@natdf
Copy link

natdf commented Jun 26, 2018

Well done Fred! I've left a couple code specific comments, but overall great job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants