- Home
- /
- Tutorials
- /
- JavaScript Tutorial
- /
- JavaScript Asynchronous
JavaScript Asynchronous
JavaScript Asynchronous
Asynchronous JavaScript starts a slow job and carries on without waiting for it.
JavaScript runs on a single thread, so it can only do one thing at a time.
If a slow job blocked that thread, the whole page would freeze.
Example
Example
javascript
console.log("first");
setTimeout(function () {
console.log("third");
}, 0);
console.log("second");