7 lines
133 B
Text
7 lines
133 B
Text
func Iterator.Filter(pred) {
|
|
for x in this when pred(x) {
|
|
yield x
|
|
}
|
|
}
|
|
|
|
[1,2,3,4,5].Iterate().Filter(x => x % 2 == 0)
|