ok, so why in this example total is equal to 9 instead of 15?
var myarr = [1,2,3,[4,5]];
var total = 0;
for (i=0; i<myarr.length; i++){
if (Array.isArray(myarr[i])){
for (j=0; j<myarr[i].length; j++){
total += myarr[i][j];
}
}
else {
console.log("no");
}
}
console.log(total);