mirror of
https://gitlab.com/mfocko/LeetCode.git
synced 2024-11-10 00:09:06 +01:00
14 lines
293 B
JavaScript
14 lines
293 B
JavaScript
|
/**
|
||
|
* @param {Object} context
|
||
|
* @param {any[]} args
|
||
|
* @return {any}
|
||
|
*/
|
||
|
Function.prototype.callPolyfill = function(context, ...args) {
|
||
|
return this.apply(context, args);
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* function increment() { this.count++; return this.count; }
|
||
|
* increment.callPolyfill({count: 1}); // 2
|
||
|
*/
|