Last active
November 23, 2021 16:38
-
-
Save rahgurung/33f707ee7824e63590b795dd36cd647b to your computer and use it in GitHub Desktop.
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 doSomething() { | |
console.log( this.x ); | |
} | |
// This is the context object | |
var obj = { | |
x: "Hello World!", | |
y: doSomething | |
} | |
obj.y(); // "Hello World!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment