UNPKG

maia-util

Version:

Utility math and music functions supporting various applications by Music Artificial Intelligence Algorithms, Inc.

24 lines (21 loc) 486 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = array_sum; function array_sum(an_array) { // Tom Collins 14/3/2015 // In // an_array Array mandatory // Out Number // Returns the sum of elements of an array. return an_array.reduce(function (a, b) { return a + b; }, 0); // Old version. // var count = 0; // for(var i = 0, n = an_array.length; i < n; i++){ // count += an_array[i]; // } // return count; }