Skip to content

Instantly share code, notes, and snippets.

@LGitHub-sprout
Last active November 15, 2022 11:11
Show Gist options
  • Save LGitHub-sprout/77e1aef1d11f90d4299fe97e8d92aad1 to your computer and use it in GitHub Desktop.
Save LGitHub-sprout/77e1aef1d11f90d4299fe97e8d92aad1 to your computer and use it in GitHub Desktop.
Info on keyword this
// https://dmitripavlutin.com/gentle-explanation-of-this-in-javascript/
// https://www.youtube.com/watch?v=zE9iro4r918
// https://stackoverflow.com/questions/13441307/how-does-the-this-keyword-in-javascript-act-within-an-object-literal
var foo = {
bar: function () {
console.log('this.baz', this.baz, 'is typeof', typeof this.baz)
return this.baz;
},
baz: 1,
};
(function () {
return typeof arguments[0].bar();
})(foo);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment