반응형
switch (new Date().getDay()) {
case 0:
day = "Sunday";
break;
case 1:
day = "Monday";
break;
case 2:
day = "Tuesday";
break;
case 3:
day = "Wednesday";
break;
case 4:
day = "Thursday";
break;
case 5:
day = "Friday";
break;
case 6:
day = "Saturday";
}
[javascript] Switch case else
switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
}
반응형
'프로그래밍 > Script' 카테고리의 다른 글
[jQuery] touch event 체크 (0) | 2019.08.19 |
---|---|
jQuery 화면전환 효과 참고 사이트 (0) | 2019.08.02 |
jsfiddle : kim hongwan's public fiddles, javascript (0) | 2019.06.13 |
Project Deadline - SVG animation with CSS3 (0) | 2019.06.12 |
Build and edit SVGs in the browser http://jxnblk.com/paths (0) | 2019.06.12 |