JavaScript curly braces with no function or json -
just opened client's javascript file , first lines along lines of this:
{ var s_account="blog"; } which don't get. normally, in experience, curly braces wrap around function...
function welcome(){ ... ...or json javascript object
var attributes = { : "that... can tell me why there curly braces no text before them or after them? / point of it?
can tell me why there curly braces no text before them or after them? / point of it?
there no significant point them in javascript. act same if code
var s_account="blog"; speculation in other languages have block scope, might restrict scope of variable, since js doesn't have feature (for better or worse), braces without control structure or function meaningless , ignored.
most code left on deleted function or if statement however. not pattern copied.
Comments
Post a Comment