79228685

Date: 2024-11-27 01:14:06
Score: 1.5
Natty:
Report link

https://jsdoc.app/tags-this

/** @this CalledClass  */
const unboundedFunction = function () { 
    console.log(this);
    this.parameter = 50;
}

class CalledClass {
  parameter = 'test';

  callOutsideFunction() {
    unboundedFunction.bind(this)();
  }

}

const obj = new CalledClass();
obj.callOutsideFunction();
Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: rookie