Created
January 30, 2019 14:20
-
-
Save bitfishxyz/dba68c6844ab2578715fa5e29b282519 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 p1 = { | |
get age(){ | |
console.log('triggle get method') | |
console.log('you can do anything as you want') | |
return 18 | |
}, | |
set age(age){ | |
console.log('triggle get method') | |
console.log('you can do anything as you want') | |
console.log(`you are trying to assign ${age} to this.age`) | |
} | |
} | |
p1.age | |
p1.age = 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment