Jose Garza - #20
Conversation
| // ==== 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 = runners.map(function(elem, index, array) { |
There was a problem hiding this comment.
Using function(elem, index, array) (rather than more descriptive names) is likely helpful if you intend to come back to this as example code, but it's a good habit to use your own variable names that are more descriptive.
Also, remember that the only required value for map/reduce/filter/forEach is the elem, representing the current item being iterated over -- so if you don't plan to use index or array, there's no need to include them (unless it's just for practice). It will still work fine, but it might be confusing or make your code appear incomplete if you pass values without using them.
| // ==== Challenge 1: Write your own closure ==== | ||
| // Write a simple closure of your own creation. Keep it simple! | ||
|
|
||
| const challenge1 = (first_name, last_name) => { |
There was a problem hiding this comment.
You did a great job making some progress on this Closure material. I think you'll get it down with practice 👍
Javascript II