
Promise.any() – Returns the first fulfilled promise. Ignores rejections unless all fail.
๐ Syntax
Promise.any([p1, p2]).then(firstSuccess => {
// first fulfilled only
});
๐งช Example
Promise.any([
Promise.reject('Fail'),
Promise.resolve('Win')
]).then(console.log);
Comments
Post a Comment