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:
References:
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.
References:
- You can also look at article about that : John Resig - ECMAScript 5 Strict Mode, JSON, and More
- You can try JSLint (The JavaScript Code Quality Tool) online by visiting:http://www.jslint.com/
- JSHint looks pretty interesting too: http://www.jshint.com/