JavaScriptBeginner#async

What is the difference between synchronous and asynchronous code?

Synchronous code runs line by line and blocks the single thread. Asynchronous code hands work to the browser or runtime and continues, resuming later through callbacks, promises or await.

Example
// blocking
while (Date.now() < end) {}
// non blocking
setTimeout(work, 0);

Related Questions

1
JavaScriptAdvanced#es6

What are generators and iterators?

Open
2
JavaScriptIntermediate#es6#modules

What is the difference between a module and a script? (import/export)

Open
3
JavaScriptIntermediate#objects

What is the difference between Object.freeze and const?

Open