map 用法: let numbers = [1,2,3,4] let result = numbers.map { $0 + 1 } print(result) // [2,3,4,5] map 方法接受一个闭包作为参数, 然后它会遍历整个数组,并对数组中每一个元素执行闭包中定义的操作。