List of utility methods to do Array Product
product()Array.prototype.product = function() { var prod = 1; for (var i = 0; i < this.length; i++) { prod *= this[i]; return prod; | |
product(begin, end)Array.prototype.product = function(begin, end) { var total = 0; for (var i = begin >> 0 || 0, len = end + 1 >> 0 || this.length >> 0; i < len; i++) { total *= +this[i] || 0; return total; }; |