Skip to content

Instantly share code, notes, and snippets.

@reime005
Created December 27, 2020 22:24
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 reime005/07ae0e72ee2d5fc6ac3adffaae56781f to your computer and use it in GitHub Desktop.
Save reime005/07ae0e72ee2d5fc6ac3adffaae56781f to your computer and use it in GitHub Desktop.
function test() {
console.log(this);
}
const test2 = () => console.log(this);
const bigObject = {
someValue: 42,
test,
test2
}
bigObject.test();
/*
{ someValue: 42,
test: [Function: test],
test2: [Function: test2] }
*/
bigObject.test2();
/*
{}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment