报错为TypeError: "callback" argument must be a function 但是在chrome中用不会报错,可以运行。这是怎么回事?
沧海一幻觉
浏览 807回答 1
1回答
慕哥9229398
nodejs环境下和浏览器环境下不同在nodejs环境下If callback is not a function, a TypeError will be thrown.在浏览器环境下,也是不推荐使用的An optional syntax allows you to include a string instead of a function, which is compiled and executed when the timer expires. This syntax is not recommended for the same reasons that make using eval() a security risk.