摘要:
七、泛型 func swapTwoInts(_ a:inout Int, _ b:inout Int) { let temp = a a = b b = temp } func swaoTwoValues<T>(_ a:inout T, _ b:inout T) { let temp = a a = 閱讀全文
posted @ 2022-02-21 09:10
weicy
閱讀(49)
評論(0)
推薦(0)
摘要:
六、面向對象編程 常見高階函數 // map print(numbers.map { $0 * 10}) // filter print(numbers.filter{ $0 > 4 }) // reduce print(numbers.reduce(10) { $0 + $1 }) // flat 閱讀全文
posted @ 2022-02-21 09:08
weicy
閱讀(53)
評論(0)
推薦(0)

浙公網安備 33010602011771號