You are not logged in.
Pages: 1
/// @desc returns sum of elements in array
/// @param {Array} a
function array_sum(a) {
return array_reduce(a, function(p, v, i) {return p+v;});
}
example:
array_test = [10, 20, 70];
show_debug_message(array_sum(array_test));
// returns 10+20+70 = 100
Offline
Pages: 1