Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

average function for javascript

function avg(arr){
	let additions = 0;
	for(let index=0; index<arr.length; index++){
    	additions += arr[index];
    }
    return (additions/arr.length);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #average #function #javascript
ADD COMMENT
Topic
Name
3+6 =