let obj = {
a: "obj foo a"
}
this.a = 1
let foo = () => {
// this.a = 34;
setTimeout(() => {
console.log(this); /// this is not bound at all
}, 100)
}
foo();
var baz = foo.bind(obj);
baz();
obj.a = "The new A value";
How to bind an obj to the foo function to access it inside timeout.