Xang Thao completed object assignment and stretch - #9
Closed
P-web-art wants to merge 6 commits into
Closed
Conversation
added 6 commits
April 16, 2018 12:22
enitchals
reviewed
Apr 17, 2018
| // ==== 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"]}` ); |
There was a problem hiding this comment.
Nice use of template literals. They're so powerful!
| // 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(); | ||
| carModels = inventory.sort(function(a, b) { |
There was a problem hiding this comment.
This is a sophisticated solution that would be great even for a dataset that was less uniform than the one we have.
| let multiplyNums = (x, y, cb) => { | ||
| // multiplyNums multiplies two numbers and passes the result to the callback. | ||
| } | ||
| return cb(x, y); |
There was a problem hiding this comment.
In this line, you're passing both x and y to the callback as two unchanged values rather than multiplying them and passing one result to the callback.
|
|
||
| let test = [1, 2, 5, 2, 6, 1, 3, 7, 1]; | ||
|
|
||
| let removeDuplicates = (array, cb) => { |
There was a problem hiding this comment.
If you move your code from removeDuplicatesCallback into the removeDuplicates function, and then pass nonDuplicates to the callback in your return statement instead of array, this should be good to go 👍
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.