Skip to content

Instantly share code, notes, and snippets.

@manekinekko
Last active September 12, 2018 11:15
Show Gist options
  • Save manekinekko/2f8c9e348ec6949e14154118a95edd7a to your computer and use it in GitHub Desktop.
Save manekinekko/2f8c9e348ec6949e14154118a95edd7a to your computer and use it in GitHub Desktop.
function foo() {
console.log(this); //=> this === window
console.log(arguments); //=> 'a', 'b', 'c'
}
var element = document.querySelector('#foo');
element.addEventListener('click', (e) => {
console.log(this); //=> element
console.log(arguments); //=> e === Event
foo('a', 'b', 'c');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment