Answers for "function returns average of array elements in percentage javascript"

0

javascript calculate average of array

const sum = times.reduce((a, b) => a + b, 0);
const avg = (sum / times.length) || 0;

console.log(`The sum is: ${sum}. The average is: ${avg}.`);
Posted by: Guest on December-01-2021

Code answers related to "function returns average of array elements in percentage javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language