Named functions can also be defined as an expression by defining an anonymous function and assigning it to a variable.
var bar = function(n, m) { console.log(n*m); };
They are not hoisted like function declarations are. This is because, while function declarations are hoisted, variable declarations are not. For example, this will not work and will throw an error:
bar(2,3); var bar = function(n, m) { console.log(n*m); };
In functional programming, we're going to want to use function expressions so we can treat the functions like variables, making them available to be used as callbacks and arguments to higher-order functions such as map()
functions. Defining functions as expressions makes it more obvious that they're variables assigned to a function. Also, if we're going to write functions in one style, we should write all functions in that style for the sake of consistency and clarity.