Created
November 5, 2017 13:16
-
-
Save sharmaabhinav/784799928bce957a00c8357b1b0c9526 to your computer and use it in GitHub Desktop.
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 Something = { | |
cool: function() { | |
this.greeting = "Hello World"; | |
this.count = this.count ? this.count + 1 : 1; | |
} | |
}; | |
Something.cool(); | |
console.log(Something.greeting) | |
console.log(Something.count); | |
var AnotherObj = { | |
cool: function () { | |
Something.cool.call(this) | |
} | |
} | |
AnotherObj.cool() | |
console.log(Something, AnotherObj) | |
AnotherObj.count = 5 | |
console.log(Something, AnotherObj) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment