Baseline Widely available
do...while
문ì í
ì¤í¸ ì¡°ê±´ì´ ê±°ì§ì¼ë¡ íê°ë ëê¹ì§ ì§ì ë 구문ì ì¤ííë 루í를 ë§ëëë¤. ë¨, êµ¬ë¬¸ì´ ì¤íë ë¤ì í
ì¤í¸ ì¡°ê±´ì´ íê°ë¨ì¼ë¡ 구문ì 무조건 í ë²ì ì¤íë©ëë¤.
let result = "";
let i = 0;
do {
i = i + 1;
result = result + i;
} while (i < 5);
console.log(result);
// Expected output: "12345"
문ë²
do {
statement;
} while (condition);
구문
í
ì¤í¸ ì¡°ê±´ì´ ì°¸ì¼ ëë§ë¤ í ë²ì´ì ì¤íëë 구문ì
ëë¤. ë§ì½ 루í ë´ìì ì¬ë¬ 구문ì ë°ë³µ ì¤í ìí¤ê³ ì¶ì¼ìë¤ë©´, ë¤ì ëª
ë ¹ì ì¬ì©í©ëë¤. block 구문ì íì©íì¬ ({ ... }
) ì´ë° ìì¼ë¡ 그룹íí©ëë¤.
ì¡°ê±´ì
루íê° ì¤íë ëë§ë¤ íê°ëë ìì
ëë¤. ë§ì½ ì¡°ê±´ìì´ ì°¸ì¼ë¡ íê°ëìë¤ë©´, 구문
ì´ ë¤ì ì¤íë©ëë¤. ë§ì½ ì¡°ê±´ìì´ ê±°ì§ì¼ë¡ íê°ëìë¤ë©´, JavaScriptë do...while
. 구문 ë°ì ìë 구문ë¤ì ì¤íìíµëë¤.
do...while
ìì ìì do...while
문ì ì ì´ë íë² ë°ë³µëê³ i ë³ìê° 5 ë³´ë¤ ìì ëê¹ì§ ì¤íë©ëë¤.
var result = "";
var i = 0;
do {
i += 1;
result += i + " ";
} while (i > 0 && i < 5);
// Despite i == 0 this will still loop as it starts off without the test
console.log(result);
ëª
ì¸ì ë¸ë¼ì°ì í¸íì± ê°ì´ 보기
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4