Created
July 16, 2019 19:06
-
-
Save ahmarsuhail/f5cf690ba4bfd2eb091f2fb9141208b4 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 user = { | |
name: "Ahmar", | |
keys: [1, 2, 3], | |
printName: function() { | |
this.keys.forEach(function(x) { | |
console.log(this.name); | |
}) | |
} | |
} | |
user.printName(); //Error: Cannot read property 'name' of undefined" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment