35. implement Filter<T, A>

TypeScript
Is this helpful ?

  - accepted / - tried

Implement Filter<T, A> to return a new tuple type by filtering all the types from T that are assignable to A.

type A = Filter<[1,'BFE', 2, true, 'dev'], number> // [1, 2]
type B = Filter<[1,'BFE', 2, true, 'dev'], string> // ['BFE', 'dev']
type C = Filter<[1,'BFE', 2, any, 'dev'], string> // ['BFE', any, 'dev']

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

Discuss(6)