Skip to content
Advertisement

What is the type of the callback function in filter of Typescript?

JavaScript

Problem is here:

JavaScript

Typescript is saying that I have not specified the type of v.
What would be the type of v here?
How to specify it?

Advertisement

Answer

depending on the orderData schema it would be like this

JavaScript

but after you map it to an array of IDso your schema would be like this

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement