4

Possible Duplicate:
Why does the JavaScript need to start with “;” ?

I've been looking at some JavaScript in the new Microsoft patterns and practises project Silk on codeplex and I've come across something I've never seen before...

What is the the purpose of the semicolon before the self executing function containing a jQuery plugin?

; (function (mstats, $) {
    // blah blah blah...
} (this.mstats = this.mstats || {}, jQuery));
Community
  • 1
  • 1
James South
  • 10,147
  • 4
  • 59
  • 115

2 Answers2

7

It's to avoid any potential problems if you concatenate/compress/minify your javascript files into a single one.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
0

This is just a coding practice to make sure that last statement had a semicolon at its end and as told by Darin

Nitin Nizhawan
  • 531
  • 4
  • 6