dash icon indicating copy to clipboard operation
dash copied to clipboard

`this` in arrow functions is wrong

Open y21 opened this issue 1 year ago • 0 comments

let f;
function F() {
  this.a = 1;
  f = () => console.log(this);
}
new F();
f();

should print F { a: 1 } but prints undefined

y21 avatar Nov 07 '23 00:11 y21