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

TimeConversion in 24 hour format

minimum and maximum values that can be calculated

calculate the absolute difference between the sums of its diagonals.