// 餐廳一份套餐 399 元
// 現在促銷活動滿 500 打八折
// vip 會員可以再打九折
// 今天vip小明和姊姊兩個人去點了兩份餐
function activity(price){
if(price < 500){
return vip(price)
}
return vip(price*0.8)
}
function vip(price){
return price*0.9;
}
let dinner = 399;
console.log(activity(dinner*2));
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.