Last active
August 29, 2015 13:56
-
-
Save CaptainYarb/9258673 to your computer and use it in GitHub Desktop.
Scope question
This file contains hidden or 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
var myVar = {bar:'foo'}; | |
myVar.someClass = function(){ | |
return { | |
foo: 'bar', | |
someFunction: function(){ | |
console.log( this.foo ); // returns 'bar' | |
// can we get myVar.bar here? | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment