[javascript] What does "use strict" do in JavaScript, and what is the reasoning behind it?

If people are worried about using use strict it might be worth checking out this article:

ECMAScript 5 'Strict mode' support in browsers. What does this mean?
NovoGeek.com - Krishna's weblog

It talks about browser support, but more importantly how to deal with it safely:

function isStrictMode(){
    return !this;
} 
/*
   returns false, since 'this' refers to global object and 
   '!this' becomes false
*/

function isStrictMode(){   
    "use strict";
    return !this;
} 
/* 
   returns true, since in strict mode the keyword 'this'
   does not refer to global object, unlike traditional JS. 
   So here, 'this' is 'undefined' and '!this' becomes true.
*/

Examples related to javascript

need to add a class to an element How to make a variable accessible outside a function? Hide Signs that Meteor.js was Used How to create a showdown.js markdown extension Please help me convert this script to a simple image slider Highlight Anchor Links when user manually scrolls? Summing radio input values How to execute an action before close metro app WinJS javascript, for loop defines a dynamic variable name Getting all files in directory with ajax

Examples related to syntax

What is the 'open' keyword in Swift? Check if returned value is not null and if so assign it, in one line, with one method call Inline for loop What does %>% function mean in R? R - " missing value where TRUE/FALSE needed " Printing variables in Python 3.4 How to replace multiple patterns at once with sed? What's the meaning of "=>" (an arrow formed from equals & greater than) in JavaScript? How can I fix MySQL error #1064? What do >> and << mean in Python?

Examples related to jslint

Why does JSHint throw a warning if I am using const? JSLint says "missing radix parameter" Should I use JSLint or JSHint JavaScript validation? How to initialize an array's length in JavaScript? What is the difference between `new Object()` and object literal notation? JSLint is suddenly reporting: Use the function form of "use strict" What does the JSLint error 'body of a for in should be wrapped in an if statement' mean? What does "use strict" do in JavaScript, and what is the reasoning behind it? Why avoid increment ("++") and decrement ("--") operators in JavaScript?

Examples related to use-strict

How is the 'use strict' statement interpreted in Node.js? What does "use strict" do in JavaScript, and what is the reasoning behind it?