Apply a callback to an array: Difference between revisions

Line 966:
 
<lang Dyalect>func Array.Select(pred) {
let ys = []
for x in this when pred(x) {
yield ys.Add(x)
}
return ys
}
 
var arr = [1, 2, 3, 4, 5]
var squares = arr.Select(x => x * x)
Anonymous user