Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015년 7월.
continue 문은 현재 또는 레이블이 지정된 루프의 현재 반복에서 명령문의 실행을 종료하고 반복문의 처음으로 돌아가여 루프문의 다음 코드를 실행합니다.
명령문의 레이블과 연관된 식별자.
break 문과 달리 continue는 루프의 실행을 완전히 종료하지 않고 for, while문에서 다음과 같이 동작합니다.
continue 문에는 현재 루프 대신 레이블이 지정된 루프 문의 다음 반복으로 건너 뛰도록하는 선택적 레이블이 포함될 수 있습니다. 이 경우, continue 문은 이 레이블 된 명령문 내에 중첩되어야합니다.
다음 예제에서는 i의 값이 3일 때 실행되는 continue문을 포함하는 while을 보여줍니다. 따라서 n은 1, 3, 7 및 12 값을 갖습니다.
다음 예제에서 checkiandj라는 문에는 checkj라는 문이 있습니다. continue가 발생하면 프로그램은 checkj 문의 맨 위에서 계속됩니다. continue가 발생할 때마다 checkj는 조건이 false를 반환 할 때까지 반복합니다. false가 리턴되면 나머지 checkiandj 문이 완료됩니다.
continue에 checkiandj 레이블이 있으면이 프로그램은 checkiandj 문 맨 위에서 계속됩니다.
See also label.
출력:
| ECMAScript® 2027 Language Specification # sec-continue-statement |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 2월 11일 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.