알맹이방
[JavaScript] switch 본문
function test2(val){
var answer = "";
switch(val){
case 1:
case 2:
case 3:
answer = "Low";
break;
case 4:
case 5:
case 6:
answer = "Mid";
break;
case 7:
case 8:
case 9:
answer = "High";
break;
}
}
'Study > Javascript' 카테고리의 다른 글
[JavaScript] 랜덤 숫자 (0) | 2021.10.06 |
---|---|
[JavaScript] Manipulating Complex Objects (0) | 2021.10.06 |
[JavaScript] 객체 생성 (Object) (0) | 2021.10.06 |
[JavaScript] boolean return, null return (0) | 2021.10.06 |
[JavaScript] === (Strict equal) (0) | 2021.10.06 |
Comments