Key Concepts

Review core concepts you need to learn to master this subject

Functions Assigned to Variables

let plusFive = (number) => { return number + 5; }; // f is assigned the value of plusFive let f = plusFive; plusFive(3); // 8 // Since f has a function value, it can be invoked. f(9); // 14

In JavaScript, functions are a data type just as strings, numbers, and arrays are data types. Therefore, functions can be assigned as values to variables, but are different from all other data types because they can be invoked.

Higher-Order Functions
Lesson 1 of 2
  1. 1
    We are often unaware of the number of assumptions we make when communicating in our native languages. If we told you to “count to three,” we would expect you to say the numbers “one”, “two”, and “t…
  2. 2
    JavaScript functions behave like any other data type in the language; we can assign functions to variables, and we can reassign them to new variables. Below, we have an annoyingly long function n…
  3. 3
    As you know, a parameter is a placeholder for the data that gets passed into a function. Sinc…
  4. 4
    Great job! By thinking about functions as data, and learning about higher-order functions, you’ve taken important steps in learning to write clean, modular code that takes advantage of JavaScript’…

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo