Functions are Objects

Let's try the typeof operator on a function.

function add (x, y) {
  return x + y;
}

console.log(typeof add)

As you have noticed, the typeof operator identifies a function as "function" (no surprise there!). However, functions are, in fact, objects (well, they are special Function objects that you can invoke). That is where the "functions are values" comes from. The fact that functions are objects enables you to treat them like other values (store them in variables, pass them to functions, etc.).

You can go so far as to create a function using an object constructor notation!

const multiply = new Function("x", "y", "return x * y;");

console.log(typeof multiply);
console.log(multiply(2, 3));

Functions, like other built-in objects, have instance properties and methods!

function add (x, y) {
  return x + y;
}

console.log(add.name);
console.log(add.length); // number of parameters
console.log(add.toString());