Function Expression

noun

say it: “FUNK-shun ik-SPRESH-un” /ˈfʌŋkʃən ɪkˈsprɛʃən/

A function created as a value and usually stored in a variable, as in const double = function (n) { return n * 2; };

What is Function Expression in JavaScript?

Function Expression — A function created as part of an expression and commonly assigned to a variable.

const total = function (price, quantity) {
    return price * quantity;
};

In a sentence

  • “I wrote a function expression and stored it in const greet, so greet("Maya") works like any other function.”

Level: Apprentice · More JavaScript terms at this level

Updated