function compact compact<T>(array: (T | null | undefined)[]): T[] Type Parameters T Parameters array: (T | null | undefined)[] Return Type T[]