Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript find average of numbers

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

average(1, 2, 3, 4);
// Result: 2.5
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #javascript #find #average #numbers
ADD COMMENT
Topic
Name
4+4 =