calculate and print the sum of the elements in an array

you are required to calculate and print the sum of the elements in an array,




function aVeryBigSum(ar) {

  let sum = 0
  for(let i=0; i<ar.length;i++){
      sum+=ar[i]
  }
  return sum
}



Comments

Popular posts from this blog

minimum and maximum values that can be calculated

TimeConversion in 24 hour format

calculate the ratios of its elements that are positive, negative, and zero. Print the decimal value of each fraction on a new line with places after the decimal.