let numbers = [1,2,3,4] let result = numbers.map { $0 + 2 } let result2 = numbers.flatMap { $0 + 2 } print(result,result2) // [3,4,5,6] let numbersCompound = [[1,3],[4,6]]; let flatRes = numbersCompound.flatMap { $0.map{ $0} } let filteredArray = flatRes.filter({$0 > 5})原文链接:https://www.f2er.com/swift/321103.html