[英]why is console.log not working inside .each?
They overwritten console 他们覆盖了控制台
> console.log.toString()
"function (){}"
It isn't printing the object instead, what you are seeing is the jQuery (array of nodes) that the .each()
function returns. 它不是打印对象,而是您看到的是.each()
函数返回的jQuery(节点数组.each()
。
The reason console.log()
is not working is that Twitter has replaced the method with an empty function, as console.log in production is considered bad practice. console.log()
无法正常工作的原因是Twitter已用空函数替换了该方法,因为生产环境中的console.log被认为是不良做法。
If you need to access console.log
you can delete the 'overridden' version that the Twitter developers have written by invoking: 如果您需要访问console.log
,则可以通过调用以下操作来删除Twitter开发人员编写的“覆盖”版本:
delete console.log
The will default console.log back to it's original function. 将默认的console.log返回到其原始功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.