Day 4 "if & switch"

Hector·2023년 3월 24일
0

Vanilla JavaScript

목록 보기
4/14
			**If**
<script>
let student = {name:"Hector",blood:"B",age: 30};

  if(student,blood==="A"){
     console.log('1st Division');
 }else if(student,blood==="B"){
     console.log('the second Division');
 }else if(student,blood==="0"){
     console.log('the third Division');
 }else{
     console.log('the fourth Division');
 }
</script>
        **Switch**
<script>
switch(student,blood){
    case "A":
        console.log('1st Division')
        break;
    case "B":
        console.log('the second Division')
        break;
    case "C":
        console.log('the third Division')
        break;
    default:
        console.log('the fourth Division')
}
</script>
profile
I`m Studying Bankend

0개의 댓글