Skip to content

Instantly share code, notes, and snippets.

@paulwib
Created December 10, 2016 15:02
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 paulwib/ba30434b1fc3f7cd9e415c5f55fa970c to your computer and use it in GitHub Desktop.
Save paulwib/ba30434b1fc3f7cd9e415c5f55fa970c to your computer and use it in GitHub Desktop.
Fat arrow fail
var foo = () => console.log(this); // foo() - `this` is undefined
var bar = function() { console.log(this) }; // bar() -`this` is window (in browser)
var fred = function() { console.log(arguments) }; // fred(1) - [1]
var dave = () => console.log(arguments); // dave(1) - Reference error, arguments is undefined!
@paulwib
Copy link
Author

paulwib commented Dec 10, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment