Putting parens after the function name would cause the function to execute immediately. So the reference that you'd be passing would be whatever was returned from the function call. For example:
function myfunction() {
return 1;
}
setTimeout(myfunction(), 100);
In that example, myfunction would execute when the setTimeout line was encountered in the code, and you would end up with the equivalent of this:
setTimeout(1, 100);
Which makes no sense.
When you pass the function name only, you're passing that function as a reference. Alternatively, you could use an anonymous function definition:
function () {}
With that syntax, the parens are not the ones used to execute the function, but rather the ones that surround the arguments in a function definition.
There are times when you may want a function to execute when setTimeout is called which would return another function reference. For example
function myfunction() {
var myPrivateVar = 1;
return (function () {
// do something with myPrivateVar
});
}
setTimeout(myfunction(), 100);
In this case, myfunction will execute when setTimeout is evaluated, and the result will be:
setTimeout(function () {
// do something with myPrivateVar
}, 100);
In this example, a closure has been created (allowing myPrivateVar to be used), and myfunction() returned another function.