Multidimensional arrays do not have to be the same as we discussed above. Look at the following array for example:
let arr = [['a', 'b', [1, 2, 3], [4, 5]], ['d', ['e', 'f']]];
As you can see, this array is "unusual". It
contains arrays ([1, 2, 3]
and
ā
cā[4, 5]) next to regular elements
(for example, 'a'
, 'b'
). Let's
rewrite our array in a more understandable way:
let arr = [
[
'a', 'b', [1, 2, 3], [4, 5],
],
[
'd', ['e', 'f'],
],
];
Given the following array:
let arr = [[1, 2, 3, [4, 5, [6, 7]]], [8, [9, 10]]];
Manually - without a loop, find the sum of this array elements.