Skip to content

Instantly share code, notes, and snippets.

@MrMeison
Created December 9, 2021 19:53
Show Gist options
  • Save MrMeison/c0623789fa43506a063c3471edcf38cc to your computer and use it in GitHub Desktop.
Save MrMeison/c0623789fa43506a063c3471edcf38cc to your computer and use it in GitHub Desktop.
var simpleObject = {
property: 4,
method: function () {
console.log(this.property);
}
};
var simpleFunction = function() {
this.property = 5;
(function() {
this.property = 3;
})();
console.log(this.property);
};
simpleFunction();
new simpleFunction();
simpleObject.method();
new simpleObject.method();
simpleFunction.call(simpleFunction);
simpleObject.method.call(simpleFunction);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment