What does the leading semicolon in a javascript file mean? -
this question has answer here:
i have file jquery.flex.js starts with

what beginning mean?
the purpose of semicolon avoid error if file concatenated one.
for example suppose have 2 files :
(function(){ ... })() it's ok long it's in 2 separate files it's error if concatenate them done reduce number of requests. happens have
(a)()(b)() and engine trying call result of (a)() argument b.
adding semicolon delimit statements fix problem.
Comments
Post a Comment