Ad
Code
Diff
  • const addArr = (arr) => {
      let sum = 0;
      arr.forEach( e => { sum += e } )
      return sum || null;
    }
    
    • const addArr = (arr) => {
    • let sum = 0;
    • for (let i = 0; i < arr.length; i++) {
    • sum += arr[i];
    • }
    • arr.forEach( e => { sum += e } )
    • return sum || null;
    • };
    • }