Created
February 1, 2012 01:53
-
-
Save anonymous/1714483 to your computer and use it in GitHub Desktop.
tyebud - pastebin.com/fhFTB3SH
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, action) { | |
for (var i = 0; i < array.length; i++) | |
action(array[i]); | |
} | |
function sum(numbers) { | |
var total = 0; | |
forEach(numbers, function (number) { | |
total += number; | |
}); | |
return total; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment