setTimeout - callback argument must be a function

后端 未结 4 1447
無奈伤痛
無奈伤痛 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 09:05

    @keyur is correct. According to the node.js timers documentation the setTimeout function takes the name of the function to execute as the first argument, the delay in milliseconds as the second argument, followed by any arguments being passed to the function.

    For Example:

    setTimeout(testFunction, 100, itemid, price);
    

提交回复
热议问题