There's a faster version of egghead. Click here to try it.
Become a member
to unlock all features

Create an egghead account to access 5000+ tutorials and resources from expert developers.

Create account

    Modify Functions with Higher Order Functions in JavaScript


    This lesson teaches the concept of higher order functions (HOF) in JavaScript, a necessary building block of functional programming in any language.

    A higher order function does at least one of the following things, often both:

    1. Accepts a function as an argument
    2. Returns a new function

    To demonstrate this, we will build a higher order function, withCount(), that modifies any function passed to it so that it logs out how many times it has been called.