Implement your own version of .bind
@Yomesh Gupta

You have to create a polyfill for .bind.

const module = {
  x: 42,
  getX: function() {
    return this.x;
  }
}

const unboundGetX = module.getX;
console.log(unboundGetX()); // The function gets invoked at the global scope
// expected output: undefined

const boundGetX = unboundGetX.customBind(module);
console.log(boundGetX());
// expected output: 42

To test and run your code, add the following in your code

const module = {
  x: 42,
  getX: function() {
    return this.x;
  }
}

const boundGetX = unboundGetX.customBind(module);
// Output should be 42.
printOutput(boundGetX());

Loading IDE...

https://www.devtools.tech/