Why not use parentheses?


I've finished the JavaScript and jQuery tutorials, and whenever we called a function, we would enter the name of the function, and then we would enter parentheses like this:

var example = function(){
    return "example";


But in the lesson, we don't use the parentheses:

var main = function(){





Hi Frogman37,

Since it's expecting a function as an input in your second example, the parenthesis aren't necessary. If you want to pass parameters along, you still could though, for example:

function double(num) {
  return num * 2;


I'm sure other people can explain the whole thing for more in-depth, but I hope this helps :)

By the way, what's a frogman?


Okay; thank you for the answer!

To answer your question, just read my bio. :)


Yeah, that took you 5 whole hours. When I posted that, I thought you said you "promptly respond"

I'm just kidding :D.


Well I'm not always on the computer. :)