Avatar
@swift-4.0.3 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().compact() print(b)