Last active
December 12, 2016 12:18
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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