Function expressions vs Function statements

function expressions and function statements are very similar in JavaScript, the difference is how the browser loads them into the execution context.

// function statement
function foo() {
}

// function expression
var foo = function() {
};

Last updated