I noticed a difference when calling a function with empty parentheses, or without any parentheses at all. However, I am not passing any arguments to the function so I wonder
I'm 6 years late but I feel this could have been explained a lot simpler than the above answers.
So here is the TLDR; or bird's eye view when calling functions using and not using ()
's
Lets take this function for example:
function foo(){
return 123;
}
()
console.log(foo);
---outout------
function foo(){
return 123;
}
Using no ()
means to fetch the function itself. You would do this if you want it to be passed along as a callback.
()
console.log(foo());
-----output-----
123
Using ()
after a function means to execute the function and return it's value.