Loading...
By continuing to use the platform, you accept the terms of the Privacy Policy and the use of cookies.
Implement promiseAllSettled(promises) function that works like native Promise.allSettled().
promiseAllSettled(promises)
Promise.allSettled()
Requirements:
const results = await promiseAllSettled([ Promise.resolve(1), Promise.reject('error'), Promise.resolve(3) ]); // results = [ // { status: 'fulfilled', value: 1 }, // { status: 'rejected', reason: 'error' }, // { status: 'fulfilled', value: 3 } // ]
Run your code to see results.
Click the Run button above