Implement the type Filter<T, Predicate> takes an Array T, primitive type or union primitive type Predicate and returns an Array include the elements of Predicate.
Filter<T, Predicate>
T
Predicate
For example:
Filter<[0, 1, 2], 2> // Expected: [2]
Code