Skip to content

Commit a9bbfb5

Browse files
committed
Added solution to q2-map
1 parent d214bf1 commit a9bbfb5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

assignments/q2-map.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
function map (xs, fn) {
2-
// ...
3-
}
2+
var trans = new Array();
3+
for (var x in xs) {
4+
trans.push(fn(xs[x]));
5+
}
6+
return trans;
7+
}

0 commit comments

Comments
 (0)