Skip to content

Instantly share code, notes, and snippets.

@kyokutyo
Created October 7, 2013 15:48
var sigma = function sigma(first, last, func) {
"use strict";
var ary = [],
i = first;
while(i <= last) {
ary.push(i++);
}
return ary.reduce(function(tmp, val) {
return tmp + func(val);
}, 0);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment