How to add up numbers in a nested array javascript
<p>Just working on a project and tried a few different solutions but with no results. Could someone help me with how to add up numbers in a nested array?  Would I use reduce? or a for loop? </p>

<pre><code>function balance(arr) {
  if(typeof item == 'number') {
    return arr;enter code here
  } else {
    return arr + balance(item);
  }
}
</code></pre>