Skip to content

Instantly share code, notes, and snippets.

@yaminmhd
Last active May 21, 2018 07:04
Show Gist options
  • Select an option

  • Save yaminmhd/c7b978e1430d92049a4f152ef67afe27 to your computer and use it in GitHub Desktop.

Select an option

Save yaminmhd/c7b978e1430d92049a4f152ef67afe27 to your computer and use it in GitHub Desktop.
const person = {
name: 'Alex',
age: 25,
sayHi: function(){
console.log(`Hi there, my name is ${this.name} and I am ${this.age} years old`)
}
}
for (let key in person){
console.log(`${key} => ${person[key]}`)
}
/*
name => Alex
age => 25
sayHi => function (){
console.log(`Hi there, my name is ${this.name} and I am ${this.age} years old`)
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment