|
|
|
|
|
by flebron
4913 days ago
|
|
I don't see the "exception to the exception", he is saying that if strict mode is on, "this" isn't the global object when saying foo(), it's undefined. And that's true. It's possible to both have "use strict" and "this" be the global object (i.e. it's not true that it's never the global object), as simple as... "use strict"; // global scope
var x = 1;
(function() {
"use strict";
return this.x;
}).call(this);
|
|
I think this is what you want