“use strict”;

Last Updated on December 1, 2015

Tells the browser, please add some extra rules when you parse and try to execute my code.

var people;
perple = {};

The result is:
Object {}

With "use strict"; the result is:
Uncaught ReferenceError: perple is not defined

"use strict" says, you must declare a variable in order to use it. Which can be really helpful when you have mistyped errors, similarly spelled functions or objects and get squirrelly responses.

It can be used at the top of your file OR at the top of a function and must be on the first line.

What it does: (from Stack Overflow) -

  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.