Skip to content

Larry simiyu - #1

Open
LarrySimiyu wants to merge 6 commits into
masterfrom
larry-simiyu
Open

Larry simiyu#1
LarrySimiyu wants to merge 6 commits into
masterfrom
larry-simiyu

Conversation

@LarrySimiyu

Copy link
Copy Markdown
Owner

No description provided.

});

console.log(fullName);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Excellent job, Larry. Here is what that same function would look like using es6 arrow syntax, btw (although both ways are totally valid!!):

Suggested change
const fullName = [];
runners.forEach(m => fullName.push(`${m.first_name} ${m.last_name}`));
console.log(fullName);


});


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great work here!
Here's the arrow function so you have it:

Suggested change
let allCaps = runners.map(person => person.first_name.toUpperCase());
console.log(allCaps);

runners.filter((currentValue) => {
return largeShirts.push(currentValue.shirt_size === "L");
});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great job here!

return ticketPriceTotal.push(accumilator + currentValue.donation);
}, 0); // starting point - starts from 0


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good job. FYI the accumulator is a 'foo bar' thing (i.e. you can name it whatever you wish).

Comment thread assignments/callbacks.js
Comment thread assignments/callbacks.js

function last(arr, cb) {
// last passes the last item of the array into the callback.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

So this function would be your callback function. You seem to be adding your cb into your test functions. Let's talk about this.

Comment thread assignments/callbacks.js
// }

// function product(a,b) {
// console.log(a*b);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I want to go over callbacks with you.

Comment thread assignments/closure.js
},
decrement() {
return count -= 1;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good.

@sabrinafilipelli

Copy link
Copy Markdown
Collaborator

Hey Larry, let's go over callbacks and I'll refactor this with you.

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