There is such an arbitrary array in which I need to find the sum of all numbers without using Array.isArray:
let arr = [[1, 2, 3, [4, 5, [6, 7]]], [8, [9, 10]]];
The solution should look something like this:
let arr = [[1, 2, 3, 4, 5], [6, 7, 8], [9, 10]];
for (let i = 0; i < arr.length; i++) {
for (let j = 0; j < arr[i].length; j++) {
console.log(arr[i][j]);
}
}
Could you please advise me on how to achieve this?
for loopto calculate the sum ?