setTimeout(): Node.js vs Web
- In Node.js, setTimeout() returns a <Timeout> object.
- In web, setTimeout() returns a number (
timeoutID).
Both return values are passed to clearTimeout() to cancel the timeout.
timeoutID).Both return values are passed to clearTimeout() to cancel the timeout.