I am looking at a JavaScript file, and it is formatted as follows:
;(function() {
// functions and stuff
})();
What does this mean, and what is this 'technique' called?
I am looking at a JavaScript file, and it is formatted as follows:
;(function() {
// functions and stuff
})();
What does this mean, and what is this 'technique' called?
This is an anonymous self-executing function.
I would refer you to these resources as of why:
https://en.wikibooks.org/wiki/JavaScript/Anonymous_functions
http://esbueno.noahstokes.com/post/77292606977/self-executing-anonymous-functions-or-how-to-write