Skip to content

Xang Thao completed object assignment and stretch - #9

Closed
P-web-art wants to merge 6 commits into
bloominstituteoftechnology:masterfrom
P-web-art:master
Closed

Xang Thao completed object assignment and stretch#9
P-web-art wants to merge 6 commits into
bloominstituteoftechnology:masterfrom
P-web-art:master

Conversation

@P-web-art

Copy link
Copy Markdown

No description provided.

@enitchals enitchals left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great work with this. If you ever want extra stretch problems, please let me know!

Comment thread assignments/arrays.js
// ==== 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"]}` );

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice use of template literals. They're so powerful!

Comment thread assignments/arrays.js
// 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) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a sophisticated solution that would be great even for a dataset that was less uniform than the one we have.

Comment thread assignments/callbacks.js
let multiplyNums = (x, y, cb) => {
// multiplyNums multiplies two numbers and passes the result to the callback.
}
return cb(x, y);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread assignments/callbacks.js

let test = [1, 2, 5, 2, 6, 1, 3, 7, 1];

let removeDuplicates = (array, cb) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 👍

@mixelpixel mixelpixel closed this May 21, 2018
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.

3 participants