Skip to content

Instantly share code, notes, and snippets.

Created February 1, 2012 01:53
Show Gist options
  • Save anonymous/1714483 to your computer and use it in GitHub Desktop.
Save anonymous/1714483 to your computer and use it in GitHub Desktop.
tyebud - pastebin.com/fhFTB3SH
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