Promise.allSettled(promises, (results) => { for(i in results) { if(results[i].status === "fulfilled") { .... } } }
Or should I do this, which feels hacky, but reduces it to 1 equality test?
const FULFILLED === "f"; Promise.allSettled(promises, (results) => { for(i in results) { if(results[i].status[0] === FULFILLED) { .... } } }
Or should I do this, which feels hacky, but reduces it to 1 equality test?