Level 22

allSettled waits for everyone

One promise fulfils and one rejects, inside Promise.allSettled.

Promise.allSettled([  Promise.resolve('ok'),  Promise.reject(new Error('no')),]).then((rs) => console.log(rs.map((r) => r.status).join(',')));console.log('sync');

1. Predict the output

Tap the lines in the order you think they print.

  1. 1…
  2. 2…