Loading homepage
Input: function greet(name) { return this.prefix + name; } greet.myApply({ prefix: 'Hi ' }, ['Ada']) Output: 'Hi Ada'
Input: function total(a, b) { return this.base + a + b; } total.myApply({ base: 10 }, [2, 3]) Output: 15
Input: function receiver() { return this; } const context = {}; receiver.myApply(context, []) === context Output: true
Implement myApply on Function.prototype to invoke a function with a chosen object receiver and arguments supplied in an array.