Loading problem…
The Function.prototype.apply() method invokes a function immediately with a specified this value and arguments provided as an array.
Implement your own Function.prototype.apply without using the native call, apply, or bind methods. To avoid overriding the built-in method, implement it as Function.prototype.myApply.
function greet(greeting, punctuation) {
return `${greeting}, ${this.name}${punctuation}`;
}
const user = { name: "Alice" };
greet.myApply(user, ["Hi", "!"]); // "Hi, Alice!"