Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

reduce average javascript

function average(nums) {
  	// nums.length is the important part
    return nums.reduce((a, b) => (a + b)) / nums.length;
}
Source by jrsinclair.com #
 
PREVIOUS NEXT
Tagged: #reduce #average #javascript
ADD COMMENT
Topic
Name
8+9 =