The javascript 'use strict'

In javascript you can tell the javascript parser to be strict - that is not to allow any errors, like forget to use var when defining code.
Below is a codeblock and the error log for code using and not using 'use strict'.
'use strict';
try {
  a=1
  b=''
  $('.output1').html('passed');
} catch(e) {
  $('.output1').html(e.message);
}
'use strict';
try {
  var a=1;
  var b='';
  $('.output2').html('passed');
} catch(e) {
  $('.output2').html(e.message);
}

Output 1


    

Output 2


    
As you can se above the first test fails as var is not used when defining a variable. Also note that 'use strict' can be used in a function making the strict parsing local to that function. I belive that best practice is not to have use strict in live code, as IE9 aparently fails to parse it.