Jim
Jim

Reputation: 107

What do brackets surrounding function name mean?

I am looking at someone else's code and trying to understand it. They have a function call name surrounded in parenthesis:

myButton.onclick = (myFunction)(a, b, c); 

Is this different than:

myButton.onclick = myFunction(a, b, c);

edit:

Just to add more context, the function myFunction has the following form:

myFunction = function(a, b, c) {
    return function () {
        // do something with a, b, and c
    }
}

Upvotes: 6

Views: 705

Answers (1)

Naftali
Naftali

Reputation: 146302

There is no difference.

They do and mean the same thing.

Upvotes: 3

Related Questions