Open
Conversation
natdf
reviewed
Jun 26, 2018
| // 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); |
There was a problem hiding this comment.
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.
natdf
reviewed
Jun 26, 2018
| 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); |
There was a problem hiding this comment.
This is just minor but something to keep in mind as a good coding practice is consistency in spacing.
|
Well done Fred! I've left a couple code specific comments, but overall great job! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.