Created
May 9, 2014 20:50
-
-
Save giuscri/a15a2ab404ba13350c72 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function forEach(array, f) { | |
for (i = 0; i < array.length; ++i) { | |
f(array[i]); | |
} | |
} | |
function foo() { | |
ret = 4; | |
return ret; | |
} | |
function map(f, array) { | |
ret = []; | |
forEach(array, function(element) { | |
ret.push(f(element)); | |
}); | |
return out; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment