Loading problem…
The Function.prototype.bind() method returns a new function with a fixed this value and optionally pre-filled arguments.
Implement your own Function.prototype.bind without using the native bind method. To avoid overriding the built-in method, implement it as Function.prototype.myBind.
function greet(greeting) {
return `${greeting}, ${this.name}`;
}
const user = { name: "Alice" };
const sayHello = greet.myBind(user, "Hello");
sayHello(); // "Hello, Alice"