Skip to content

Instantly share code, notes, and snippets.

@xavdid
Created April 10, 2016 23:55
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 xavdid/f31a04ba502acc82cb45ce8498a2b011 to your computer and use it in GitHub Desktop.
Save xavdid/f31a04ba502acc82cb45ce8498a2b011 to your computer and use it in GitHub Desktop.
Fat arrow scope conundrum
'use-strict';
// using node v5.7.1
var funcs = {
speak: function(){
console.log(this.name + ' says hi');
},
name: 'david'
};
var fatFuncs = {
speak: () => {
console.log(this.name + ' says hi');
},
name: 'david'
};
funcs.speak();
fatFuncs.speak();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment