setTimeout - callback argument must be a function

后端 未结 4 1446
無奈伤痛
無奈伤痛 2021-01-22 08:07

My code was working until i updated node.js to version 8.11.3

Now i always get error \"callback argument must be a function\" when trying to call a function with setTim

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-22 08:54

    Yes, setTimeout() expects first argument as callback function. we can make use of es6 fat arrow function here you can try this!

    setTimeout(() => testFunction(itemid, price), 100);
    

    Hope this helps!

提交回复
热议问题