Answers for "how to find the average in an array"

CSS
8

how to calculate average of array in javascript

const arrAvg = arr => arr.reduce((a,b) => a + b, 0) / arr.length
Posted by: Guest on March-23-2020
-2

Get the Average of an Array of Number

const average = (...array) => array.reduce((a, b) => a + b) / array.length

average(21, 56, 23, 122, 67)
//57.8
Posted by: Guest on April-14-2022

Code answers related to "how to find the average in an array"

Browse Popular Code Answers by Language