Skip to content

Instantly share code, notes, and snippets.

@codemilli
Created April 7, 2016 08:15
Show Gist options
  • Select an option

  • Save codemilli/567a41f781e8f23d8596dcb2b57260fe to your computer and use it in GitHub Desktop.

Select an option

Save codemilli/567a41f781e8f23d8596dcb2b57260fe to your computer and use it in GitHub Desktop.
let obj1 = {
cb: function () {
let that = this;
let fun = function () {
console.log('this => ', this); // undefined
console.log('that => ', that); // { cb: [Function] }
};
fun();
}
};
let obj2 = {
cb: function () {
let fun = () => {
console.log('this => ', this); // { cb: [Function] }
};
fun();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment