JavaScript is single threaded language.
Synchronous programming is execution of functions in order.
Asynchronous programming is executing a long running process outside the main thread. It does not block code execution on main thread. Although it is achieved usually by running asynchronous function on separate thread. Though javascript is a single threaded language it supports aysnchronous behaviour, to understand how we need to understand JS runtime.
No comments:
Post a Comment