Skip to content

Instantly share code, notes, and snippets.

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 kevinhooke/e947616387182b7fe00485b6bc392f4e to your computer and use it in GitHub Desktop.
Save kevinhooke/e947616387182b7fe00485b6bc392f4e to your computer and use it in GitHub Desktop.
JavaScript .call()
#calls a function setting the value for 'this' within the function
functionName.call(someThisValue, otherParams);
- the first param passed is the value for 'this' when this is referenced within that function
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment