find out the sum of all numbers in array code example
Example 1: sum of all numbers in an array javascript
const arrSum = arr => arr.reduce((a,b) => a + b, 0)
Example 2: how to find sum of array
//C++
int arr[5]={1,2,3,4,5};
int sum=0;
for(int i=0; i<5; i++){sum+=arr[i];}
cout<<sum;