Vote count:
1
The following code in Swift's playground or Console App:
let letters = ["A", "B", "C"]
letters.filter({
(x : String) -> Bool in
println(x)
return true
})
Prints out:
A
B
C
A
B
C
Why does it iterate over the collection twice?
asked 48 secs ago
Aucun commentaire:
Enregistrer un commentaire