我制作了这段代码来覆盖所有窗口函数并在函数运行后放置一个console.log,但它给了我错误问题是什么?
未捕获的类型错误:没有足够的参数
for (func in window) {
if (typeof window[func] === 'function' && typeof window[func] != 'undefined') {
var s = window[func];
window[func] = function (a) {
s(a);
console.log(func);
}
}
}
alert("hehe");