Skip to content

Conversation

@JGolden25
Copy link

@kait_schorr

@kait-schorr
Copy link

kait-schorr commented Aug 10, 2018

Objectives

  • Student should be able to describe what closure is, how closure is created in a program and why it is important to have different types of scope
  • Student should be able to demonstrate the proper use a of a callback function by passing a function to another function as a parameter
  • Student should be able to demonstrate ability to use .map .reduce .filter and describe their use cases

Great

  • The array-methods and callback exercises look great!
  • Your code is well structured.
  • Good job attempting the stretch goal!

Requested Improvements

  • Try to commit more frequently and with meaningful messages
  • The assignment is incomplete. You still need to do the following:
    • Challenge 5 in arrays, Write your own questions and solve them!
    • Finish the closure exercises
  • See line by line comments for suggestions/corrections

Questions

  • What benefits do callbacks offer us?

Rating: {1-3}

Incomplete

}
else {
return false;
}

Choose a reason for hiding this comment

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

So this method will not actually work for contains. There are two possible scenarios:

  1. The element you are looking for is the first element in the array, so your method returns true
  2. The element you are looking for is either in the array elsewhere, or isn't in the array and your method returns false

The reason for this is the structure of your if statement. Essentially as soon as you run the if statement one time, one of the returns will fire and the function will be exited. If you move the return false out of your for loop, it should fix the problem.

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.

2 participants