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?
- Abstraction allows us to write complicated code in a way that’s easy to reuse, debug, and understand for human readers
- We can work with functions the same way we would any other type of data including reassigning them to new variables
- JavaScript functions are first-class objects, so they have properties and methods like any object
- Functions can be passed into other functions as parameters
- A higher-order function is a function that either accepts functions as parameters, returns a function, or both.
What I'll be doing tomorrow?
No comments:
Post a Comment