Created
August 16, 2015 15:51
-
-
Save robin-drexler/78e2ce8272fc5485ff66 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
var dog = { | |
get age () { | |
console.log('accessed age'); | |
return this._age; | |
}, | |
set age (age) { | |
console.log('set age'); | |
this._age = age; | |
} | |
}; | |
dog.age = 8; | |
console.log(dog.age); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment