I am calling 2 functions using Promise.all function, where I am passing an odd number and an even number. Based on the number I am deciding the success or failure.
const time11=(t) =>{
  return new Promise((resolve,reject) =>{
   if(t%2==0){
     resolve(t)
   }else{
     reject(t)
   }
  })
}
// Promise.all
Promise.all([time11(101), time11(1210)])
 .then(result => console.log('success',result))
 .catch(error=> console.log('error',error))
I expect the output is success 1210 and error 101, but the actual output is error 101.
 
     
    