sindresorhus / debounce

Delay function calls until a set time elapses after the last invocation
Other
798 stars 80 forks source link

confuse execution branch #24

Closed jituanlin closed 6 years ago

jituanlin commented 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.