Skip to content

Instantly share code, notes, and snippets.

@CodHeK
Last active June 8, 2020 17:18
Show Gist options
  • Save CodHeK/44fbb2791979b32f50c3dfb5e624109d to your computer and use it in GitHub Desktop.
Save CodHeK/44fbb2791979b32f50c3dfb5e624109d to your computer and use it in GitHub Desktop.
const obj = {
prop: 'Hello',
method: function() {
'use strict'
function inner() {
console.log(this === undefined); // true
console.log(this.prop + ', World!'); // TypeError: Cannot read property 'prop' of undefined
}
inner();
}
};
obj.method();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment