JavaScript에서 일반적인 for를 통한 순회
배열은 for-of 루프가 아닌 일반적인 for를 통해서도 순회할 수 있습니다:
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]);
}
}
이전 두 문제를 for 루프를 사용하여 해결하세요.