• A Promise is an object that returns a value which you hope to receive in future but not now
  • Js is always sync and single-threaded. It means JS never wait for code or function result when they take some time, JS direct execute next code.
  • 1. Producing code. -> fetch
  • Assuming code -> .then / .catch / .finally

Works on condition where more than one promises are working together.

  • 1. Promise.all -> all promises fail if one fails
  • 2. Promise.allsettled -> which promises are pass and which are fails
  • 3. Promise.race -> give the result of promise which complete first.
                
                    
                
            
                

Console