filterNullish([1, null, 2, undefined, 3]) // β [1, 2, 3]Using a type predicate filter removes null and undefined, narrowing the array element type.
Challenge: Implement filterNullish<T>(arr: (T | null | undefined)[]): T[] returning only non-null, non-undefined values.
filterNullish([1, null, 2, undefined, 3]) // β [1, 2, 3]