Slide 15
Slide 15 text
Copyright © 2024 treastrain / Tanaka RyogaɹAll rights reserved.
#iosdc #a
Built-in Sequence Implementations
15
let odds = [1, 3, 5, 7, 9]
let evens = odds.map { $0 + 1 }
print(evens) // [2, 4, 6, 8, 10]
let fullName = "Tanaka Ryoga"
let initials = fullName.filter(\.isUppercase)
print(initials) // TR