Skip to main content
5 of 5
Use HTTPS link
Michael M.
  • 11.2k
  • 11
  • 22
  • 46

It's a new feature of ECMAScript 5. John Resig wrote up a nice summary of it.

It's just a string you put in your JavaScript files (either at the top of your file or inside of a function) that looks like this:

"use strict"; 

Putting it in your code now shouldn't cause any problems with current browsers as it's just a string. It may cause problems with your code in the future if your code violates the pragma. For instance, if you currently have foo = "bar" without defining foo first, your code will start failing...which is a good thing in my opinion.

seth
  • 37.3k
  • 7
  • 63
  • 58