syntax - What does the leading semicolon in JavaScript libraries do? -


In many JavaScript libraries I saw this beginning at the very beginning:

  / ** * Library XYZ * /; (Function () {// ... and so on  

While I am completely comfortable with the "Quickly Executed Function" syntax

  ( Function () {...}} ()  

I was wondering what is the main semicolon. I can come with everyone, this is an insurance, if the library is second , Is embedded in the buggy code, so it "concludes at the latest type of speed bump of the last statement."

Has it got any other functionality?

This allows you to secure several JS files by adding them to one, so that it can be completed as an HTTP request quickly.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -