LeetCodeCall Function with Custom ContextCall Function with Custom ContextMediumSolution declare global { interface Function { callPolyfill(context: Record<any, any>, ...args: any[]): any; } } Function.prototype.callPolyfill = function (context, ...args): any { return this.bind(context)(...args); }; export {};LeetCode Logo With TextLeetCode LogoLeetCodeCall Function with Custom Contexthttps://leetcode.com/problems/call-function-with-custom-context