DEV Community

Discussion on: How async/await works in Array reduce

Collapse
 
anil1kuppa profile image
anil1kuppa

Is there a way to define type in Promise.resolve {} accumulator.
I'm using Typescript.
Getting this error: stackoverflow.com/questions/524238...
But, I was wondering how I can define type.

Collapse
 
anil1kuppa profile image
anil1kuppa • Edited

I found a similar answer here: dev.to/pedrohasantiago/typescript-...
I had to define a type and do it.
Promise.resolve({points:0,
areAllOrdersCompleted:false,
pendingorderId:[]
}