Loading challenge...
Preparing the challenge details...
Loading challenge...
Preparing the challenge details...
Implement Function.prototype.apply from scratch — identical to call except arguments arrive as a single array.
apply is call with a different argument shape. Everything about context handling, Symbol keys, and cleanup is the same. The only difference: the second argument is an array (or array-like) that gets spread into the function call. Handle the case where args is omitted or not an array.
Goal: Implement myApply. Reuse your call logic — the only new piece is handling the args array.
Continue learning with these related challenges
Implement Function.prototype.call from scratch using the temporary-property trick and a Symbol key to avoid collisions.
Implement a Function.prototype.call polyfill from scratch. Master JavaScript this binding, execution context, primitive boxing, and safe property assignment techniques.
Implement Function.prototype.bind from scratch, including partial application and the new-operator edge case that almost nobody gets right.
Implement Function.prototype.call from scratch using the temporary-property trick and a Symbol key to avoid collisions.
Implement a Function.prototype.call polyfill from scratch. Master JavaScript this binding, execution context, primitive boxing, and safe property assignment techniques.
Implement Function.prototype.bind from scratch, including partial application and the new-operator edge case that almost nobody gets right.