Loading problem…
Implement your own version of Function.prototype.call method. The call method calls a function with a given this value and arguments provided individually.
thisArg parameter to be used as the this valuethis contextnull or undefined as thisArg (should default to global object)function greet(greeting, punctuation) {
return `${greeting}, ${this.name}${punctuation}`;
}
const person = { name: 'Alice' };
// Using built-in call
greet.call(person, 'Hello', '!'); // "Hello, Alice!"
// Using your implementation
greet.myCall(person, 'Hello', '!'); // "Hello, Alice!"