According to this article
Adding “use strict” as the first statement¹ in your JavaScript code
will enforce Strict Mode over the entire
So why :
"use strict";
012;
Doesn’t throw errors
while
(function () {
"use strict";
012; })();
does ? (Octal literals are not allowed in strict mode.)
John resig says nothing about it. he just says :
Simple. Toss this at the top of a program to enable it for the whole
script:"use strict"; Or place it within a function to turn on strict mode
only within that context.function imStrict(){ "use strict"; // … your code … }
edit :

edit #2.
I tested the code in console.(chrome). in jsbin sample – it is working. still , I dont understand why it behave different in console.
It does throw an error.