function solution17(arr1, arr2) {
const result = [];
for (let i = 0; i < arr1.length; i++) {
const array = [];
// 1) []
// 2) []
for (let j = 0; j < arr1[i].length; j++) {
array.push(arr1[i][j] + arr2[i][j]);
// 1) [4,6]
// 2) [7,9]
}
result.push(array);
// 1) [[4,6],[7,9]]
//
}
return result;
}
console.log(
solution17(
[
[1, 2],
[2, 3],
],
[
[3, 4],
[5, 6],
]
)
); // [[4,6],[7,9]];
console.log(solution17([[1], [2]], [[3], [4]])); // [[4],[6]];