Node.js · Middle · Question 9 of 75
What does timer.unref() do?
- 1Makes the timer run on another thread
- 2Cancels the timer
- ✓Correct answer: Lets the process exit even if this timer is still pending
Explanation
Normally an active timer keeps the process alive. unref is useful for background tasks like periodic metrics that shouldn't prevent shutdown. ref() undoes it.