i am having issues (very lost) in making a code that me and my friend were given to create.
So I am suppose to compute and return the average of all values in a given array named customerBalance, the array holds the amount of "what customers owe my business" (I dont own a business) and each item in the array holds the "customers balance", i also have to use a for() to process the array and calculate the average and divide by customerBalance length, and finally return the average.
Here is my code so far
function average() {
customerBalance
for(i=0,i++)
sum(customerBalance)
total=sum/5
return average;
I know that this is COMPLETELY wrong, I am not sure on how i start typing the array, please don't be harsh I would really like to know how to do this.
Thank you and have a great day