Non-Blocking Operations Javascript
- Non-blocking actions are operations that don't halt execution of the main thread.
- This means that while the action is in progress, the Javascript engine can continue processing other tasks.
Examples of non-blocking actions
- Fetching data from a server (fetch)
- Timer (setTimeout)
- Handling user interactions (like permissions)
- Using web workers:
- Web workers allow javascript to run tasks in a separate thread which can improve performance & responsiveness