Skip to content

Instantly share code, notes, and snippets.

@kristyburge
Created July 27, 2018 23:11
Show Gist options
  • Save kristyburge/1408f8119e90883a5fa96fa587a9e844 to your computer and use it in GitHub Desktop.
Save kristyburge/1408f8119e90883a5fa96fa587a9e844 to your computer and use it in GitHub Desktop.
Arrow functions example
var objReg = {
hello: function() {
return this;
}
};
var objArrow = {
hello: () => this
};
objReg.hello(); // returns the objReg object that we expect
objArrow.hello(); // returns the Window object!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment