Sagar Desai - #36
Closed
sagardesai90 wants to merge 4 commits into
Closed
Conversation
ghost
reviewed
Apr 17, 2018
| console.log(`Car 33 is a *car year goes here* *car make goes here* *car model goes here*` ); | ||
|
|
||
| for (i = 0; i < inventory.length; i++){ | ||
| if (inventory[i].id == 33){ |
ghost
reviewed
Apr 17, 2018
| for (i = 0; i < inventory.length; i++){ | ||
| carModels.push(inventory[i].car_model); | ||
| } | ||
| console.log(carModels.sort()); |
ghost
reviewed
Apr 17, 2018
| let carYears = []; | ||
| console.log(); | ||
| for (i = 0; i < inventory.length; i++){ | ||
| carYears.push(inventory[i].car_year); |
ghost
reviewed
Apr 17, 2018
| console.log(); | ||
| for (i = 0; i < carYears.length; i++){ | ||
| if (carYears[i] < 2000){ | ||
| oldCars.push(carYears[i]); |
ghost
reviewed
Apr 17, 2018
| let BMWAndAudi =[]; | ||
| console.log(); | ||
| for (i = 0; i < inventory.length; i++){ | ||
| if (inventory[i].car_make == "BMW" || inventory[i].car_make == "Audi"){ |
There was a problem hiding this comment.
Okay I think you're solid on these topics.
ghost
reviewed
Apr 17, 2018
|
|
||
| function firstItem(arr, cb) { | ||
| // firstItem passes the first item of the given array to the callback function. | ||
| const callbacks1 = function(item){ |
There was a problem hiding this comment.
Isn't it so much easier if you compose an actual callback to use cb? 👍
ghost
reviewed
Apr 17, 2018
| // Pass true to the callback if it is, otherwise pass false. | ||
| for (let i = 0; i < list.length; i++){ | ||
| if (list[i] == item){ | ||
| cb(true); |
There was a problem hiding this comment.
You know what, we should have added a break or a return in that if statement.
I'm sorry I didn't see this sooner.
ghost
reviewed
Apr 17, 2018
| console.log(arr2); | ||
| let res = []; | ||
| for (i = 0; i < arr2.length; i++){ | ||
| if (res.includes(arr2[i]) != true){ |
There was a problem hiding this comment.
I strech you to try using the includes that you build but it would work similarly. 👍
|
Great job man thank you for updating. |
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.