Skip to content

Instantly share code, notes, and snippets.

@Omkaragrawal
Created May 18, 2020 23:34
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 Omkaragrawal/be908395f2a273606c08b16178091e55 to your computer and use it in GitHub Desktop.
Save Omkaragrawal/be908395f2a273606c08b16178091e55 to your computer and use it in GitHub Desktop.
ction f1() {
return this;
}
// In a browser:
f1() === window; // true
// In Node:
f1() === globalThis; // true
const test = {
prop: 42,
func: function() {
return this.prop;
},
};
console.log(test.func());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment