Learn JavaScript
Advanced JavaScript
25.14
Lesson

Function Expression

When we assign a function to a variable, it is called a “Function Expression”. It can either be a named function expression or an unnamed function expression.

Named function expression

In the example given below, addTwoNumbers is the name of the function, and is a named function expression.

Unnamed function expression

In the example given below, the variable add stores the function expression. Here, the function does not have a name of its own.