forked from Mirror/wren
Add List.map method and test
This commit is contained in:
@ -16,4 +16,12 @@ class List {
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
map (f) {
|
||||
var result = []
|
||||
for (element in this) {
|
||||
result.add(f.call(element))
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user