Thursday, April 25, 2019

JavaScript(8)---HIGHER-ORDER FUNCTIONS intro

HIGHER-ORDER FUNCTIONS
  • Higher-order functions are functions that accept other functions as arguments and/or return functions as output. This enables us to build abstractions on other abstractions, just like “We hosted a birthday party” is an abstraction that may build on the abstraction “We made a cake.”
  • We call the functions that get passed in as parameters and invoked callback functions because they get called during the execution of the higher-order function.
What did I learned?
  1. Abstraction allows us to write complicated code in a way that’s easy to reuse, debug, and understand for human readers
  2. We can work with functions the same way we would any other type of data including reassigning them to new variables
  3. JavaScript functions are first-class objects, so they have properties and methods like any object
  4. Functions can be passed into other functions as parameters
  5. A higher-order function is a function that either accepts functions as parameters, returns a function, or both.
What I'll be doing tomorrow?

Iterators

No comments:

Post a Comment