What does the leading semicolon in a javascript file mean? -


this question has answer here:

i have file jquery.flex.js starts with

enter image description here

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

Popular posts from this blog

javascript - How to name a jQuery function to make a browser's back button work? -

python - Django-easy-pdf: xhtml2pdf reporting reportlab 2.2+ is required, but 3.0 installed -

collision detection - C++ library for mesh to mesh intersection: what is available? -