1
0
forked from Mirror/wren

Add List.map method and test

This commit is contained in:
Kyle Marek-Spartz
2014-02-14 23:06:29 -06:00
parent b1bae8fc6c
commit 83ea5aaf45
3 changed files with 21 additions and 0 deletions

View File

@ -16,4 +16,12 @@ class List {
}
return result
}
map (f) {
var result = []
for (element in this) {
result.add(f.call(element))
}
return result
}
}