Skip to content

Instantly share code, notes, and snippets.

@rayinla
Last active December 9, 2017 13:46
Show Gist options
  • Save rayinla/627ff2e3ba10183a8c1bf110e5a13873 to your computer and use it in GitHub Desktop.
Save rayinla/627ff2e3ba10183a8c1bf110e5a13873 to your computer and use it in GitHub Desktop.
var myHouse = {
neighborhood: "Cherry Wood",
address: "5 Premium Park",
city: "Rolly",
state: "NC",
printInfo(){
// 'this' refers to the object we created.
//'this' is easy to conceptualize here because...
//we have manually created an object that we can see
return this.neighborhood + "," + this.address + "," + this.city + "," + this.state
}
}
myHouse.printInfo() // >> "Cherry Wood,5 Premium Park,Rolly,NC"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment