Created
June 26, 2018 22:17
-
-
Save colevandersWands/7250ab0e591cc532ca94af791f496db5 to your computer and use it in GitHub Desktop.
methods & properties
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
// --- | |
// don't think about functions in objects just yet | |
// only string, numbers, ... | |
// --- | |
let obj = { | |
p: "roperty", | |
m: function ethod() { | |
console.log(this.p) | |
} | |
} | |
console.log(obj.p) // "roperty" | |
obj.m() // print "roperty" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment