다중 if문
다중 if문은 두 가지 이상 조건식과 정해 높은 조건을 만족하지 않았을 때 실행되는 코드로 이루어져 있다.
다중 if문
<script>
let food = prompt("다음 중 가장 먹고 싶은 음식은? 1.커피 3.팝콘 4.카레 4.초콜렛");
if(food=="카레"){
document.write("오뚜기카레")
}else if(food=="커피"){
document.write("아메리카노")
}else if(food=="초콜렛"){
document.write("가나초콜렛")
}else if(food=="팝콘"){
document.write("오리지널 팝콘")
} else{
document.write("먹고싶은 것이 없습니다.")
}
</script>
//오뚜기카레(카레를 적을 시)Last updated