It\'s considered good practice to use a self-invoking function to wrap strict mode compliant code, often called the strict mode pragma:
(function(){
\"use stri
Benefit of alt 2 and 3 is that they keep all of the code inside the "container function." One line of code outside of the function is easy to miss when reading the code.
Also: