1
function isKoreanFood(food) {
if (["불고기", "비빔밥", "떡볶이"].includes(food)) return true;
}
console.log(isKoreanFood("떡볶이")); // true
2
const meal = {
한식: "불고기",
중식: "멘보샤",
양식: "스테이크",
인도식: "카레"
};
const getMeal = (mealType) => {
return meal[mealType] || "굶기";
};
console.log(getMeal("한식")); // meal["한식"] = "불고기" key를 가져옴
console.log(getMeal()); // "굶기"