Javascript values seem to be concaternated and not added together
<p>I have a function which job is to get a total from values from an array, however it doesn't work. EG. my array looks like </p>

<pre><code>    [["10", "", ""], ["10", "", ""], ["10", "", ""]]
</code></pre>

<p>So the value i am expecting is 30 however i am getting 0101010 in console.log</p>

<pre><code>function createAv(results){
    var av = results;

    var a1 = 0;
    var a2 = 0;
    var a3 = 0;

    function percentage(av){
    var n1 = 0;
    for (var index = 0; index &lt; av.length; index++) {

            n1 += av[index][0];
        a1 = (av[0][0] / n1) * 100; 
        a2 = (av[1][0] / n1) * 100; 
        a3 = (av[2][0] / n1) * 100; 
    }
      return n1;
    }

    var test = (percentage(av));

    return test;

  }
</code></pre>
