Closures & Functions
Implement Custom Call and Apply
mediumJS SpecificJS / TS3 tests
Problem Statement
Implement `myCall(fn, context, ...args)` and `myApply(fn, context, argsArray)` without using native `Function.prototype.call` or `Function.prototype.apply`.
Examples
Example 1:
function sum(b) { return this.a + b; }
myCall(sum, { a: 10 }, 5); // 15
myApply(sum, { a: 10 }, [5]); // 15JavaScript & TypeScript starter code included
Run this as a live interviewPractice solo
3 test cases. No second person needed.