Answers for "javascript find average of numbers"

0

javascript find average of numbers

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

average(1, 2, 3, 4);
// Result: 2.5
Posted by: Guest on September-28-2021
-1

calculate average in javascript

var a = [80, 77, 88, 95, 68];

console.log(eval(a.join('+'))/a.length)
Posted by: Guest on July-09-2020

Code answers related to "javascript find average of numbers"

Code answers related to "Javascript"

Browse Popular Code Answers by Language