JavaScript-II by Paul DeYonghe - #311
Open
pdeyo70 wants to merge 2 commits into
Open
Conversation
kiachoi
approved these changes
Aug 20, 2018
kiachoi
left a comment
There was a problem hiding this comment.
✔️ What Went Well:
- Callbacks
- Array Methods
- Closures
- Arrow Function syntax
- Easy to understand commit messages
🎗 Recommendation(s):
- There were a bit of formatting and syntax issues.
Other:
- Aside from the comment you made earlier about what you did and did not complete, it seems like you are understanding the material!
- 2/3
| // The event director needs both the first and last names of each runner for their running bibs. Combine both the first and last names into a new array called fullName. | ||
| let fullName = []; | ||
| const forEachCallback = (item, index, array) => { | ||
| fullName.push(item.first_name + item.last_name); |
There was a problem hiding this comment.
I would suggest adding a space in between first_name and last_name.
| // Pass true to the callback if it is, otherwise pass false. | ||
| let tempArr = []; | ||
| for (let i = 0; i < list.length; i++){ | ||
| if list[i] === item; |
There was a problem hiding this comment.
I know what you are trying to output but the way that it is written is incorrect.
| tempArr.push(list[i]); | ||
| } | ||
|
|
||
| if tempArr.length !== 0 { |
There was a problem hiding this comment.
Please wrap your boolean argument in parantheses - good coding practice :D
| // newCounter(); // 1 | ||
| // newCounter(); // 2 | ||
|
|
||
| constant newCounter = counter(); |
There was a problem hiding this comment.
Did you mean const instead of constant?
| // The large shirts won't be available for the event due to an ordering issue. Get a list of runners with large sized shirts so they can choose a different size. Return an array named largeShirts that contains information about the runners that have a shirt size of L and log the result | ||
| let largeShirts = []; | ||
|
|
||
| largeShirts.push(runners.filter(runner => runner.shirt_size === "L")); |
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.
This is mostly completed. I have left undone the creativity-oriented exercises in array-menthods.js, mainly due to time constraints. These and the stretch goals are all I have left undone.