반복문은 두 개 이상 중첩 가능합니다. 2개의 반복문의 중첩된 경우 = 이중반복문 ,
3개의 반복문의 중첩된 경우 = 3중반복문
for (let first = 0; first <= 3; first++) {
for (let second = 0; second <= 3; second++) {
for (let third = 0; third <= 3; third++) {
console.log(
`first는 ${first}, second는 ${second}, third는 ${third}입니다.`
);
}
}
}
'[JavaScript] 기초 > 반복문' 카테고리의 다른 글
Chapter5-5. while문 (0) | 2022.12.19 |
---|---|
Chapter5-3. 반복문과 조건문 (0) | 2022.12.19 |
Chapter5-2. 반복문 활용하기 (0) | 2022.12.19 |
Chapter5-1. for문 (0) | 2022.12.19 |
댓글