What is the difference between these three statements?
function foo(n){ return n; } var foo = function(n){ return n; }; var foo = new Function('n', 'return n');
At first glance, they're merely different ways to write the same function. But there's a little more going on here. And if we're to take full advantage of functions in JavaScript in order to manipulate them into a functional programming style, then we'd better be able to get this right. If there is a better way to do something in computer programming, then that one way should be the only way.