Ad

Esta solucion es clave, tenela en cuenta pa.

Code
Diff
  • function addArr(arr){
      return arr.reduce((num,acc)=>num+acc,0) || null
    }
    • function addArr(arr){
    • if(arr.length === 0) return null
    • let final = 0
    • arr.forEach(num => {
    • final += num
    • })
    • return final
    • return arr.reduce((num,acc)=>num+acc,0) || null
    • }