Reputation: 107
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