While 루프와 break;

piper ·2023년 1월 8일
0

Java Script 

목록 보기
9/22

while (조건문) {
반복문 구문
if(조건문) break;}

● if 조건문이 참일 경우에 while 루프를 종료하여라

let input = prompt ("Hey, say something!")
while (true) {
    input = prompt (input);
     if (input === "stop copying me!") {
        break;
     }
}
console.log ("OK you win!")
profile
연습일지

0개의 댓글