Sunday, 29 September 2013

What are the advantages of assigning a function to a variable in javascript?

What are the advantages of assigning a function to a variable in javascript?

In javascript recently I learned how to assign a function to a variable,
such as
Variable = function(){};
But how is that any better than calling the below
function Variable() {};
What are the advantages of the variable way of calling a function?

No comments:

Post a Comment