Merge pull request #18 from zeckalpha/feature/list-map

Add List.map method and test
This commit is contained in:
Bob Nystrom
2014-02-15 09:12:04 -08:00
3 changed files with 21 additions and 0 deletions
+8
View File
@@ -59,6 +59,14 @@ static const char* libSource =
" }\n"
" return result\n"
" }\n"
" \n"
" map (f) {\n"
" var result = []\n"
" for (element in this) {\n"
" result.add(f.call(element))\n"
" }\n"
" return result\n"
" }\n"
"}\n";
// Validates that the given argument in [args] is a Num. Returns true if it is.