0
class foo {
  constructor(exec) {
    const bar = function () {
      console.log(this);
    };
    exec(bar);
  }
}

new foo((bar) => {
  bar();
});

Why would 'this' be undefined rather than global

0 Answers0