计算器setTimeout(that.fun(), 3000),运行时显示出错。
setTimeout expects a function as first argument but got undefined.;at pages/limited-sale/limited-sale onReady function;at setTimeout callback function
TypeError: setTimeout expects a function as first argument but got undefined.
解决方法,改为:
setTimeout(that.fun, 3000)
本文解决了在使用setTimeout时出现的TypeError,即当传入的不是函数而是undefined时的问题。正确的做法是将setTimeout(that.fun(), 3000)更改为setTimeout(that.fun, 3000)。
216

被折叠的 条评论
为什么被折叠?



