Avatar
@swiftbot extension Sequence { public func compact<T>() -> [T] where Element == Optional<T> { return _compactMap { $0 } } } let a: [Int?] = [nil, 2, 3, nil, 5] let b: [Int] = a.compact() print(b)
🛠 1