Conversation
| console.log(fullName); | ||
|
|
||
| runners.forEach(function(item){ | ||
| fullName.push(`${item.first_name} ${item.last_name}`) |
| console.log(allCaps); | ||
|
|
||
| runners.map(function(item){ | ||
| return allCaps.push(item.first_name.toLocaleUpperCase()); |
There was a problem hiding this comment.
toUpperCase please, I know vscode suggests toLocaleUpperCase but compare and contrast the two in the documentation.
There was a problem hiding this comment.
And you're doing too much, either return or push. Here a return would be appropriate because map returns a new array.
| let ticketPriceTotal = []; | ||
|
|
||
| runners.reduce(function(item1, item){ | ||
| return ticketPriceTotal.push(item1 + item.donation); |
| let donationsUnder = []; | ||
|
|
||
| runners.filter(function(item){ | ||
| return donationsUnder.push(item.donation < 150); |
There was a problem hiding this comment.
I'd like you to try this again, and seek disambiguation.
| let newEmail = []; | ||
|
|
||
| runners.map(function(item){ | ||
| return newEmail.push(item.email); |
| let allCompanies = []; | ||
|
|
||
| runners.forEach(function(item){ | ||
| allCompanies.push(item.company_name); |
| let largeShirts = []; | ||
|
|
||
| runners.filter(function(item){ | ||
| return largeShirts.push(item.shirt_size !== "L"); |
There was a problem hiding this comment.
Filter has a return, use that for your assignment not a push.
| }); | ||
|
|
||
| // Problem 3 No newline at end of file | ||
| console.log(allCompanies); No newline at end of file |
There was a problem hiding this comment.
All in all on this page, I'd like you to spend more time in the documentation before you use the available methods. Very close but some mixing of paradyms, I'm not even suprised though, I expect it.
| return newProfile; | ||
| } | ||
| let newGreeting = profile(); | ||
| console.log(newGreeting()); |
| const newCounter = counter(); | ||
| console.log(newCounter()); | ||
| console.log(newCounter()); | ||
| console.log(newCounter()); |
| console.log(reverseNewCounterFactory()); | ||
| console.log(reverseNewCounterFactory()); | ||
| console.log(newCounterFactory()); | ||
| console.log(reverseNewCounterFactory()) No newline at end of file |
There was a problem hiding this comment.
Functionally equivilent but I'd instead try using
counterFactory.increment = counterFactory();
counterFactory.decrement = reverseCounter();
``` to salvage the composition
But what we were looking for is the counterFactory to return an object that contains the functions increment and decrement.
|
|
||
| const sum = exampleArray.map(x => x * 3); | ||
|
|
||
| console.log(sum); No newline at end of file |
ghost
left a comment
There was a problem hiding this comment.
Somethings to address but don't beat yourself up. It'll make sense sooner or later. 👍 Keep up the great work but I'd like you to pair program with someone whom you've never worked with today to keep it fresh.
Completed array-methods