문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 다음 판 | 이전 판 | ||
|
wiki:javascript:javascript_note:js_switch [2021/04/26 18:25] emblim98 만듦 |
wiki:javascript:javascript_note:js_switch [2023/01/13 18:44] (현재) |
||
|---|---|---|---|
| 줄 145: | 줄 145: | ||
| =====Switching Details===== | =====Switching Details===== | ||
| - | 다수의 | + | 다수의 |
| \\ | \\ | ||
| - | 일치하는 cases가 없으면, 프로그램은 **default** 레이블로 계속됩니다.\\\\ | + | 일치하는 |
| - | + | \\ | |
| - | default 레이블이 없는 경우, 프로그램은 switch 이후의 스테이트먼트로 계속됩니다.\\ | + | %%default%% 레이블이 없는 경우, 프로그램은 |
| =====Strict Comparison===== | =====Strict Comparison===== | ||
| 줄 162: | 줄 162: | ||
| \\ | \\ | ||
| <code javascript> | <code javascript> | ||
| + | let x = " | ||
| + | switch (x) { | ||
| + | case 0: | ||
| + | text = " | ||
| + | case 1: | ||
| + | text = " | ||
| + | break; | ||
| + | default: | ||
| + | text = "No value found"; | ||
| + | } | ||
| + | document.getElementById(" | ||
| </ | </ | ||