setTimeout() is not actually part of JavaScript 🤯
Even in Node.js.
When you write:
setTimeout(() => {
console.log("Hello");
}, 2000);
the timer is NOT handled by JavaScript itself.
In browsers:
Timers come from Web APIs implemented in C++
In Nod
codewithishwar.hashnode.dev1 min read