Katie Gorbell JavaScript-I#96
Open
kgorbell wants to merge 4 commits intobloominstituteoftechnology:masterfrom
Open
Katie Gorbell JavaScript-I#96kgorbell wants to merge 4 commits intobloominstituteoftechnology:masterfrom
kgorbell wants to merge 4 commits intobloominstituteoftechnology:masterfrom
Conversation
holly-g
reviewed
May 22, 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.
Don't forget that the index starts at 0 instead of 1. Car 33 is at index 32.
| // 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. | ||
| let oldCars =[]; | ||
| console.log(); | ||
| for (let i=0; i <inventory.length; i++) { |
There was a problem hiding this comment.
You'll need to use the carYears array instead of inventory.
| let carYears = []; | ||
| console.log(); | ||
| for (let i=0; i < inventory.length; i++) { | ||
| carYears[i] = inventory[i].car_year; |
holly-g
reviewed
May 22, 2018
|
|
||
|
|
||
| for (let i=0; i < inventory.length; i++) { | ||
| if (inventory[i].car_make === 'BMW' || inventory[i].car_make === 'Audi') { |
There was a problem hiding this comment.
Consider using loose equality == as opposed to strict equality ===.
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.