Answers for "javascript array average reduce"

3

reduce average javascript

function average(nums) {
  	// nums.length is the important part
    return nums.reduce((a, b) => (a + b)) / nums.length;
}
Posted by: Guest on December-08-2020
14

sum of all numbers in an array javascript

const arrSum = arr => arr.reduce((a,b) => a + b, 0)
Posted by: Guest on March-23-2020
4

javascript reduce sum

arrSum = function(arr){  return arr.reduce(function(a,b){    return a + b  }, 0);}
Posted by: Guest on October-22-2019

Code answers related to "javascript array average reduce"

Code answers related to "Javascript"

Browse Popular Code Answers by Language