I didn’t understand why
callback is used ? For section Functional Programming, new users are suddenly get introduced to
callback without proper introduction to this concept.
Can we please fix this ? It’s super confusing concept coming from Java world.
- Within the body of a prototype method you can use this in order to retrieve the object that immediately precedes the call of that method.
Applying this to the challenge:
- Within the function
Array.prototype.myFilter you can use
this in order to access the data from the array
s to be filtered.
- That is to say,
this[i] are sensible constructs within the body of
- The argument
myFilter is the filtering function defined within the call to
myFilter; i.e. the lambda filtering function.
Thanks @RandellDawson @pgeerkens for clarifications.
I’m finding it quite hard to understand concept of callback, may be FCC should have added a chapter on this instead of jumping into that concept