Are semicolons in JavaScript functions declarations ever necessary -
is ever necessary add semicolon @ end of function definition following
function helloworld() { //some code }; //note semicolon here @ end ever necessary? ever i have friend swears optional. think never optional have never read being optional @ end of function. have never seen 1 ever "except him". semi colon optional.
var hellworld = function (){ }; // semicolon here optional because defining variable ok , optional
semicolons delimit expressions. can add amount of semicolons after one, since they'd delimiting empty statements.
function() { // works. };;;;;;;;;;;;;;;;;;;;; that semicolon after function not "optional", it's plain redundant.
as optional ones, because javascript add semicolons before newlines in situations 1 needed. these should write explicitly. you'll bitten lack of auto-semicolon sooner or later.
Comments
Post a Comment