From cfe2c0db4f64318d1116a67b76b12b23ba347720 Mon Sep 17 00:00:00 2001 From: Psychedelic Squid Date: Wed, 7 Mar 2012 03:22:25 +0000 Subject: [PATCH] Sum function. --- snippets.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/snippets.js b/snippets.js index b769658..8e6a9af 100644 --- a/snippets.js +++ b/snippets.js @@ -27,6 +27,14 @@ Array.prototype.include = function(value) { return false; }; +Array.prototype.sum = function() { + var sum = 0; + for(var i=0;i