JSFiddle - React, Tailwind, and code Playground

by Salmin Skenderovic

JavaScript

const A = new Promise((resolve, reject) => {
  setTimeout(() => {
    resolve('rejected')
  }, 1000)
})

const B = new Promise((resolve, reject) => {
  setTimeout(() => {
    reject('rejected')
  }, 1000)
})


A.then(x => console.log('A - done', x))
A.catch(x => console.log('A - Reject', x))


B.then(x => console.log('B - done', x))
B.catch(x => console.log('B - Reject', x))