Skip to content

Instantly share code, notes, and snippets.

@ahmarsuhail
Created July 16, 2019 19:03
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 ahmarsuhail/c492d8cad5f38ef5724142d1d0d8983c to your computer and use it in GitHub Desktop.
Save ahmarsuhail/c492d8cad5f38ef5724142d1d0d8983c to your computer and use it in GitHub Desktop.
const user = {
name: "Ahmar",
keys: [1, 2, 3],
printName: function() {
this.keys.forEach((x) => {
console.log(this.name);
})
}
}
user.printName(); //Outputs: "Ahmar", "Ahmar", "Ahmar"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment