Specifying Function Expressions
In this lesson we will learn how to specify a function expression. Let's begin!
We'll cover the following...
JavaScript has a number of great things that are built on function expressions. Just like other objects, functions can be assigned to variables:
Press + to interact
var add = function (a, b) {return a + b;}
This assignment ensures that you can invoke the function through the variable, just like if it were a statically declared function:
Press + to interact
var add = function (a, b) {return a + b;}console.log(add(12, 23));
...