Last active
October 14, 2017 22:06
-
-
Save Fouzyyyy/d98250c47dddc4a15ca195fe4e4e1d87 to your computer and use it in GitHub Desktop.
This variable in arrow functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var obj = {foo: 'foo', bar: 'bar'}; | |
function func() { | |
// IIFE! | |
(() => { | |
console.log(this); | |
})(); | |
} | |
let boundFunc = func.bind(obj); | |
boundFunc(); | |
// printed value: {foo: "foo", bar: "bar"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment