Get average value of items in a javascript array
Sun Jan 05 2020 19:39:47 GMT+0000 (Coordinated Universal Time)
Saved by @bezequi #javascript #webdev #arrays #math
In this function, we first use reduce() to reduce all values in our array to a single sum. Once we have the sum we simply divide this value by the length of the array. The result is the average value which then gets returned.
https://codeburst.io/javascript-arrays-finding-the-minimum-maximum-sum-average-values-f02f1b0ce332
Comments