Skip to content

Tyrone Cartwright---Started JavaScript II - #414

Open
Tyrone-Cartwright wants to merge 11 commits into
bloominstituteoftechnology:masterfrom
Tyrone-Cartwright:master
Open

Tyrone Cartwright---Started JavaScript II#414
Tyrone-Cartwright wants to merge 11 commits into
bloominstituteoftechnology:masterfrom
Tyrone-Cartwright:master

Conversation

@Tyrone-Cartwright

Copy link
Copy Markdown

No description provided.

@trevorfehrman trevorfehrman 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.

Awesome job sir. Nailed it.

let allCaps = [];
console.log(allCaps);
allCaps = runners.map(item => item.first_name.toUpperCase());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

looks great

// ==== 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 = [];
ticketPriceTotal = runners.reduce((total, item) => total + item.donation, 0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good semantic parameters.

Comment thread assignments/closure.js
console.log(`My favorite sport is ${sport}!`);

function favPlayer() {
const player = 'Kyrie Irving';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perfect example, great job dude.

Comment thread assignments/closure.js
// Return a function that when invoked increments and returns a counter variable.
let count = 0;

return () => (++count);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Try to explain in your own words why line 20 works. It's a good exercise.

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