This file contains 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
// refactored code | |
// first set of functions received from Jake | |
// sum function worked upon receiving; did not modify | |
var sum = function(array){ | |
var total = 0; | |
for(var index in array) | |
total += array[index]; | |
return total; | |
} | |