JavaScript Auto-bound behavior of arrow functions
Consider
class c {
a=1;
autoBound = () => {console.log(this.a);}
}
const C=new c();
const {autoBound}=C;
console.log(autoBound);
autoBound();
Output
() => {console.log(this.a);}
1
As you can see, even when autoBound has been extracted out f...
loganlee.hashnode.dev1 min read