Functions Are Just Variables

Functions Are Flexible

We'll cover the following

Functions in Javascript are considered to be first class, meaning they are treated like any other variable we can make use of. This allows us to store functions as items in an array or as properties in an object.

Let’s see how this plays out in practice. Here we have four variables, each of them functions, that complete some operation on two numbers:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy