How would you extend Array in JavaScript so that it could add all the values stored in an array?
Anonymous
Array.prototype.addValues = function(){ var out=0; for (x = 0; x < arr.length; x++){ out = out + arr[x]; } return out; }
Check out your Company Bowl for anonymous work chats.