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

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -