Closed jituanlin closed 6 years ago
last < wait && last >= 0 always false, because setTimeout(later, wait), The node.js will ensure the later function call after at least wait time elapse. So, the Date.now() - timestamp> wait will always true.
last < wait && last >= 0
setTimeout(later, wait)
later
wait
Date.now() - timestamp> wait
last < wait && last >= 0
always false, becausesetTimeout(later, wait)
, The node.js will ensure thelater
function call after at leastwait
time elapse. So, theDate.now() - timestamp> wait
will always true.