Skip to content

Instantly share code, notes, and snippets.

@benedyktdryl
Last active December 12, 2016 12:18
Show Gist options
  • Save benedyktdryl/10018152 to your computer and use it in GitHub Desktop.
Save benedyktdryl/10018152 to your computer and use it in GitHub Desktop.
Why is “this” in an anonymous function undefined when using strict? http://stackoverflow.com/a/9822631/689748
(function(){
"use strict";
(function() {
console.log(this);
})();
function test() {
console.log(this);
}
test();
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment