Skip to content

Tyrone Cartwright---Started JavaScript II#414

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

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

Conversation

@Tyrone-Cartwright
Copy link

No description provided.

Copy link

@trevorfehrman trevorfehrman left a comment

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());

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);

Choose a reason for hiding this comment

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

Good semantic parameters.

console.log(`My favorite sport is ${sport}!`);

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

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.

// Return a function that when invoked increments and returns a counter variable.
let count = 0;

return () => (++count);

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