Skip to content

Jose Garza - #20

Closed
jggarza5 wants to merge 2 commits into
bloominstituteoftechnology:masterfrom
jggarza5:master
Closed

Jose Garza#20
jggarza5 wants to merge 2 commits into
bloominstituteoftechnology:masterfrom
jggarza5:master

Conversation

@jggarza5

Copy link
Copy Markdown

Javascript II

@enitchals enitchals left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! I know you had some trouble with Closure, but don't worry -- it will click.

// ==== 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) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread assignments/closure.js
// ==== Challenge 1: Write your own closure ====
// Write a simple closure of your own creation. Keep it simple!

const challenge1 = (first_name, last_name) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You did a great job making some progress on this Closure material. I think you'll get it down with practice 👍

@mixelpixel mixelpixel closed this May 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants