Strict Mode is a new feature in ECMAScript5 that allows you to place a program, or a function, in a “strict” operating context. It is a way to introduce better error-checking into your code. When you use strict mode, you cannot, for example, use implicitly declared variables, or assign a value to a read-only property, or add a property to an object that is not extensible. The restrictions are listed in the Restrictions on Code in Strict Mode (http://msdn.microsoft.com/en-us/library/ie/br230269%28v=vs.94%29.aspx#rest).
It can be applied to the whole file, Or you can use it only for a specific function.
Strict mode helps out in a couple ways:1). It catches some common coding bloopers, throwing exceptions.2). It prevents, or throws errors, when relatively "unsafe" actions are taken (such as gaining access to the global object).3). It disables features that are confusing or poorly thought out.
Hope this answer is helpful
من قبل
Mohammad Arif , Principal Engineer UI , NatWest Group
Essentially we should use it to write better JavaScript, Nicholas article is great, he explained things in detail pretty well.
Now every other tool's like JSHint/JSLint gives you the same error if you don't use 'use strict' unless until, you turn it off.
+1 for Fadi/Rizwan.