Declare functions in JavaScript -
this question has answer here:
i have code:
function myfunction(){ alert("hello"); } and other code:
var myfunction = function(){ } what difference?
the first normal way declare function in javascript. call referring name, myfunction().
the second anonymous function stored in variable functions first class citizens in javascript. variable myfunction holds anonymous function.
basically first normal function while second variable holding anonymous function.
Comments
Post a Comment