Javascript newbie function doubts -


this question has answer here:

i learning javascript , never got idea of difference between creating function this:

var justme = function(param1, param2) {      code code code; }; 

and this:

function justme(param1, param2) {     code code code; } 

and why in second example semi-colon not requiered @ end, in first example?

i'll give simply.

function justme(param1, param2) {     code code code; } 

here declaring function in it's original syntax.

var justme = function(param1, param2) {      code code code; }; 

here assigning function body variable , hence require end semicolon.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -