JavaScript: Can ECMAScript 5’s Strict Mode (“use strict”) be enabled using single quotes (‘use strict’)?

For you, without using a browser that supports strict mode: A Use Strict Directive is an ExpressionStatement in a Directive Prologue whose StringLiteral is either the exact character sequences “use strict” or ‘use strict’. A Use Strict Directive may not contain an EscapeSequence or LineContinuation.

Are there any .NET CLR/DLR implementations of ECMAScript?

Currently, I’ve modified a version of the EcmaScript.NET inside my YUICompressor.NET port (project). If you grab the source code from here, I’ve included my modified code in the project, which you can reference. This is the only source of code i’ve found in .NET which can handle parsing javascript, server side. Unfortunately, I can’t remember … Read more

In ECMAScript5, what’s the scope of “use strict”?

“use strict” applies only to function or program scope. So if you have fileA.js with “use strict” at the top, fileA.js executes in strict mode, and all functions defined in it will do the same when called. But fileB.js is a separate program, so the “use strict” from fileA.js doesn’t apply to it — and … Read more

Can I disable ECMAscript strict mode for specific functions?

No, you can’t disable strict mode per function. It’s important to understand that strict mode works lexically; meaning — it affects function declaration, not execution. Any function declared within strict code becomes a strict function itself. But not any function called from within strict code is necessarily strict: (function(sloppy) { “use strict”; function strict() { … Read more

Is there any way to check if strict mode is enforced?

The fact that this inside a function called in the global context will not point to the global object can be used to detect strict mode: var isStrict = (function() { return !this; })(); Demo: > echo ‘”use strict”; var isStrict = (function() { return !this; })(); console.log(isStrict);’ | node true > echo ‘var isStrict … Read more

Why is there no OFFICIAL JavaScript reference? [closed]

It’s not like there is an official JavaScript release. All the browsers have made their own JavaScript engine – some are using the same though. But especially Internet Explorer has its own version that doesn’t support a lot of what the other browsers support, making it very difficult to make a general JavaScript reference. Edit: … Read more

Why was the arguments.callee.caller property deprecated in JavaScript?

Early versions of JavaScript did not allow named function expressions, and because of that we could not make a recursive function expression: // This snippet will work: function factorial(n) { return (!(n>1))? 1 : factorial(n-1)*n; } [1,2,3,4,5].map(factorial); // But this snippet will not: [1,2,3,4,5].map(function(n) { return (!(n>1))? 1 : /* what goes here? */ (n-1)*n; … Read more