jcassidy - #203
Open
cassidyjamesw wants to merge 1 commit into
Open
Conversation
zackhitch
approved these changes
Aug 9, 2018
| // 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 = []; | ||
| runners.forEach(function(element) { | ||
| fullName.push(element.first_name + ' ' + element.last_name); |
| // ==== Challenge 2: Use .map() ==== | ||
| // The event director needs to have all the runner's first names converted to uppercase because the director BECAME DRUNK WITH POWER. Convert each first name into all caps and log the result | ||
| let allCaps = []; | ||
| let allCaps = fullName.map(x => x.toUpperCase()); |
There was a problem hiding this comment.
Nice use of the fullName array instead of the runners array. And by keeping this to one line, you forgo the need to for curly braces or the need to explicitly state return. Well done.
| // 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 = []; | ||
| let largeShirts = runners.filter((shirt) => { | ||
| return shirt.shirt_size === 'L' |
| let ticketPriceTotal = []; | ||
|
|
||
| let ticketPriceTotal = runners.reduce((donations, item) => { | ||
| return donations += item.donation; |
| @@ -2,33 +2,75 @@ const items = ['Pencil', 'Notebook', 'yo-yo', 'Gum']; | |||
|
|
|||
| add(); | ||
| console.log(add()) | ||
|
|
||
| /* STRETCH PROBLEM, Do not attempt until you have completed all previous tasks for today's project files */ |
There was a problem hiding this comment.
💪 push yourself to complete all the tasks and stretch problems!
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.