Created
June 9, 2019 18:39
-
-
Save fortunee/e275487b10ce16accee7e2cfe94608d6 to your computer and use it in GitHub Desktop.
The third rule of javascript this keyword example
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
// Rule #3 example | |
function RuleThree() { | |
this.value = 'Some value for rule #3'; | |
this.printValue = function() { | |
console.log('Rule three value >>>>', this.value); | |
} | |
} | |
const ruleThreeInstance = new RuleThree(); | |
const ruleThreePrintValue = ruleThreeInstance.printValue; | |
ruleThreePrintValue(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment