35. implement Filter<T, A>
Share
- 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']