As seen here, there are some differences between function declaration and function expression.
A function expression has one disadvantage vs a function declaration, if called before its been declared it will give an error.
I would like to know only the advantages to use a function expression as I only seem to see the disadvantage I just named above. I possible with an example...
function expression:
alert(foo()); // ERROR! foo wasn't loaded yet
var foo = function() { return 5; }
function declaration:
alert(foo()); // Alerts 5. Declarations are loaded before any code can run.
function foo() { return 5; }