-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Brandon Benefield: JavaScript-II #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Brandon Benefield: JavaScript-II #40
Conversation
| // ==== Challenge 4: Use .reduce() ==== | ||
| // 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 = []; | ||
| let ticketPriceTotal = runners.map(runner => runner.donation).reduce((x, y) => x + y, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exceptional work.
| // Problem 3 | ||
| // Log the largest donation | ||
| const largestDonation = runners.map(runner => runner.donation).sort((x, y) => x - y).reverse()[0]; | ||
| console.log(largestDonation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work on this one! 💯
| @@ -1,19 +1,57 @@ | |||
| // ==== Challenge 1: Write your own closure ==== | |||
| // Write a simple closure of your own creation. Keep it simple! | |||
| function simpleClosure(name) { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hahaha great work
| return count++; | ||
| } | ||
|
|
||
| return addIt; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect execution of the callback.
| console.log(foo.increment()); | ||
| console.log(foo.increment()); | ||
| console.log(foo.increment()); | ||
| console.log(foo.decrement()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on this file aswell. 💯
ghost
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm impressed with where you are at. 💯
No description provided.