What does Strict Mode bring to us
- strict mode eliminates some JavaScript silent errors by changing them to throw errors.
- strict mode fixes mistakes that make it difficult for JavaScript engines to perform optimizations: strict mode code can sometimes be made to run faster than identical code that’s not strict mode
- strict mode prohibits some syntax likely to be defined in future versions of ECMAScript.
Invoking Strict Mode
- Strict mode applies to entire scripts or to individual functions. It doesn’t apply to block statements enclosed in {} braces;
- It is recommended that you enable strict mode on a function-by-function basis, because concatenating strict and non-strict scripts is problematic.
Changes in strict mode
- Converting mistakes into errors
- Simplifying variable uses
- Making eval and arguments simpler
- “Securing” JavaScript
- Paving the way for future ECMAScript versions