Larry simiyu - #1
Open
LarrySimiyu wants to merge 6 commits into
Open
Conversation
added 2 commits
January 22, 2019 16:41
sabrinafilipelli
requested changes
Jan 23, 2019
| }); | ||
|
|
||
| console.log(fullName); | ||
|
|
Collaborator
There was a problem hiding this comment.
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); |
|
|
||
| }); | ||
|
|
||
|
|
Collaborator
There was a problem hiding this comment.
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"); | ||
| }); | ||
|
|
| return ticketPriceTotal.push(accumilator + currentValue.donation); | ||
| }, 0); // starting point - starts from 0 | ||
|
|
||
|
|
Collaborator
There was a problem hiding this comment.
Good job. FYI the accumulator is a 'foo bar' thing (i.e. you can name it whatever you wish).
|
|
||
| function last(arr, cb) { | ||
| // last passes the last item of the array into the callback. | ||
|
|
Collaborator
There was a problem hiding this comment.
So this function would be your callback function. You seem to be adding your cb into your test functions. Let's talk about this.
| // } | ||
|
|
||
| // function product(a,b) { | ||
| // console.log(a*b); |
Collaborator
There was a problem hiding this comment.
I want to go over callbacks with you.
| }, | ||
| decrement() { | ||
| return count -= 1; | ||
| } |
Collaborator
|
Hey Larry, let's go over callbacks and I'll refactor this with you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.