这是js权威指南上的一个例子,我运行的时候报了 Illegal invocation 错误。。我是我不知道为什这样写会报错,求告知。谢谢。代码如下:
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
原因在于
console.log这个函数实现需要console作为函数的this因为 log /info 等使用时,上下文需要是 console