Skip to content

Ashukr321/asynchronous-javascript-guide

Repository files navigation

Asynchronous Javascript

Topics covered

  1. Synchronous vs asynchronous code
  2. How asynchronous code is executed
  3. What is the execution thread
  4. Event loop
  5. Ajax
  6. Callback hell
  7. Promises object methods
  8. Async and await
  9. Static and instance Promise methods
  10. How response.json() works
  11. Error handling with try/catch
  12. Interview questions

Promise static methods

Static methods are called directly on the Promise class reference (not on an instance).

Method Description
Promise.all() Takes an array of promises; rejects immediately if any one rejects
Promise.allSettled() Resolves once every promise has settled, regardless of fulfilled/rejected
Promise.any() Resolves with the first fulfilled promise; order not preserved
Promise.race() Settles as soon as the first promise settles (fulfilled or rejected)
Promise.reject() Returns a promise rejected with the given reason
Promise.resolve() Returns a promise resolved with the given value
Promise.try() Runs a function and wraps its result/thrown error in a promise
Promise.resolvers() Returns { promise, resolve, reject } as a convenience object

Folder map

# Topic Folder
01 Synchronous vs Asynchronous 01_synchronous-vs-asynchronous
02 Asynchronous behind the scene 02_asynchronous-behind-the-scene
03 Execution thread 03_execution-thread
04 Event loop 04_event-loop
05 Ajax call 05_ajax-call
06 Callback hell 06_callback-hell
07 Promises object method 07_promises-object-method
08 Async vs await 08_async-vs-await
09 Promises static/instance methods (all, allSettled, any, race) 09_promises-methods-example
10 API / response.json() 10_api
11 Error handling with try/catch 11_error-handling-with-try-catch
12 Interview questions 12_interview-questions

About

This repository is a deep-dive exploration into the world of asynchronous programming in JavaScript. It covers the transition from traditional callback patterns to modern Promises and async/await, with a heavy emphasis on the engine's internal mechanics.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors