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 1loc.dev #
 
PREVIOUS NEXT
Tagged: #average #function #javascript
ADD COMMENT
Topic
Name
7+4 =