Skip to content

Instantly share code, notes, and snippets.

@bitfishxyz
Created January 30, 2019 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitfishxyz/dba68c6844ab2578715fa5e29b282519 to your computer and use it in GitHub Desktop.
Save bitfishxyz/dba68c6844ab2578715fa5e29b282519 to your computer and use it in GitHub Desktop.
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