JS strict mode

After a few months off it’s a good idea to refresh my rusty memory. I’ll write down my quick notes on the stuff I’m looking at.

Strict mode was added with ECMAScript 5 and supported on IE >= 10 and the other browsers.

You can enable it file-wide by placing this string (“directive prologue”) at the top of the file:

"use strict";

Or enable it only for a function (and placing it in the function body).

function foo()
  "use strict";
  ...
}

What it does

Here are the most noticeable changes:

The other changes are less important (to me).