Skip to content

Instantly share code, notes, and snippets.

@rahgurung
Last active November 24, 2021 14:24
Show Gist options
  • Save rahgurung/93db5a7d658fdea375952442ae74ef21 to your computer and use it in GitHub Desktop.
Save rahgurung/93db5a7d658fdea375952442ae74ef21 to your computer and use it in GitHub Desktop.
function increase() {
// increment each time
this.x++;
}
// Create a property to the function object
increase.x = 0;
// Call function few times
increase();
increase();
console.log(increase.x); // 0 which means this doesn't refers the function itself
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment