题目
封装函数 f,使 f 的 this 指向指定的对象
示例1
输入:
无 输出: 无
编辑
核心代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>修改this指向</title> </head> <body> <script>function bindThis(f, oTarget) { return function (x, y) { return f.call(oTarget, x, y); }; } </script> </body> </html>
