41. implement FindIndex<T, E>

TypeScript
Is this helpful ?

  - accepted / - tried

Just like Array.prototype.findIndex(), please implement FindIndex<T, E>.

type A = [any, never, 1, '2', true]
type B = FindIndex<A, 1> // 2
type C = FindIndex<A, 3> // never

Let's try to solve this problem within 10 mintues.

Discuss(4)