Strict Mode is a new feature in ECMAScript 5 that allows you to place a program, or a function, in a "strict" operating context. This strict context prevents certain actions from being taken and throws more exceptions. Strict mode helps out in a couple ways:
Also note you can apply "strict mode" to the whole file... Or you can use it only for a specific function. Conclusion is it helps you make fewer errors, by detecting more things that could lead to breakages.
- It catches some common coding bloopers, throwing exceptions.
- It prevents, or throws errors, when relatively "unsafe" actions are taken (such as gaining access to the global object).
- It disables features that are confusing or poorly thought out.
- You can also look at article about that : John Resig - ECMAScript 5 Strict Mode, JSON, and More
- JSHint looks pretty interesting too: http://www.jshint.com/