Last active
August 18, 2017 20:59
-
-
Save radzionc/090ecc8c62f07ea3c40dd65afb773a20 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
const dog = { | |
name: 'Ronni', | |
age: 4, | |
talk: function() { | |
retun `my name is ${this.name}` | |
} | |
} | |
// if you have some variables around | |
const name = 'Ronni' | |
const age = 4 | |
const talk = function() { | |
retun `my name is ${this.name}` | |
} | |
// Power of JS | |
const dog = { name, age, talk } | |
// if you have dog object around you can extract properties this way | |
const { name, age, talk } = dog | |
const dogTold = talk() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment