列表

详情


FED21. 修改 this 指向

描述

封装函数 f,使 f 的 this 指向指定的对象

示例1

输入:

输出:

原站题解

HTML/CSS/JavaScript 解法, 执行用时: 856ms, 内存消耗: 77772KB, 提交时间: 2021-07-04

{"css":"","js":"function bindThis(f, oTarget) {\n    return function(){\n        return f.apply(oTarget,arguments)\n    }\n}","html":"","libs":[]}

HTML/CSS/JavaScript 解法, 执行用时: 856ms, 内存消耗: 77828KB, 提交时间: 2020-10-30

{"css":"","js":"function bindThis(f, oTarget) {\n    return f.bind(oTarget)\n}","html":"","libs":[]}

HTML/CSS/JavaScript 解法, 执行用时: 858ms, 内存消耗: 77772KB, 提交时间: 2020-12-16

{"css":"","js":"function bindThis(f, oTarget) {\n        return function () {\n            return f.apply(oTarget,arguments)\n        }\n    }","html":"","libs":[]}

HTML/CSS/JavaScript 解法, 执行用时: 858ms, 内存消耗: 77776KB, 提交时间: 2021-05-30

{"css":"","js":"function bindThis(f, oTarget) {\n    return function() {\n        return f.call(oTarget, ...arguments)\n    }\n    \n}","html":"","libs":[]}

HTML/CSS/JavaScript 解法, 执行用时: 858ms, 内存消耗: 77816KB, 提交时间: 2020-12-24

{"css":"","js":"function bindThis(f, oTarget) {\n    return f.bind(oTarget);\n}","html":"","libs":[]}

上一题