Skip to content

Javascript-II#224

Open
upsmancsr wants to merge 4 commits intobloominstituteoftechnology:masterfrom
upsmancsr:master
Open

Javascript-II#224
upsmancsr wants to merge 4 commits intobloominstituteoftechnology:masterfrom
upsmancsr:master

Conversation

@upsmancsr
Copy link

Copy link

@zackhitch zackhitch left a comment

Choose a reason for hiding this comment

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

Very well done!

console.log("\nChallenge 1:");
let fullName = [];

runners.forEach(function(element) {

Choose a reason for hiding this comment

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

Great job! Its good practice to assign this to a variable, so that you can reuse the data should you need to in the future. Example let runnerNames = runners.forEach(......

let allCaps = [];
console.log("\nChallenge 2:");
let allCaps = runners.map(function(runner) {
return runner["first_name"].toUpperCase();

Choose a reason for hiding this comment

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

let largeShirts = [];
console.log("\nChallenge 3:");
let largeShirts = runners.filter(function(runner) {
return runner["shirt_size"] === "L";

Choose a reason for hiding this comment

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

// The donations need to be tallied up and reported for tax purposes. Add up all the donations into a ticketPriceTotal array and log the result
let ticketPriceTotal = [];
console.log("\nChallenge 4:");
let ticketPriceTotal = runners.reduce(function(donationTotal, runner) {

Choose a reason for hiding this comment

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

console.log(PassedArgument);
}

firstItem(items, TestFunction1);

Choose a reason for hiding this comment

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

return cb(arr.length);
}

getLength(items, function(length) {

Choose a reason for hiding this comment

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

return cb(arr[arr.length - 1]);
}

last(items, function(lastWord) {

Choose a reason for hiding this comment

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

}

sumNums(2, 3, TestFunction1);

Choose a reason for hiding this comment

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

return cb(x * y);
}

multiplyNums(2, 3, TestFunction1);

Choose a reason for hiding this comment

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

if (item === list[i]) {
return cb(true);
}
return cb(false);

Choose a reason for hiding this comment

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

Great! I think just line just needs to be moved out of the for loop, so just after line 68.

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.

2 participants