Open
Description
Doc URL(s)
https://nodejs.org/en/learn/asynchronous-work/discover-javascript-timers
Description of the problem
In Node.js, setTimeout() and setInterval() returns a Timeout object, which can be used to cancel or manipulate the timer. In browsers, it returns a numeric timer ID. The current Node.js documentation says these functions return a "timer ID", which can be misleading in the Node context.
Docs should reflect Node-specific behavior more precisely
- Browser devs might expect a number and be confused when console.log(setTimeout(...)) gives them an object.
- They might not realize unref() and other methods are available.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
📋 Backlog