摘要:
七、泛型 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号