Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function theatrePromotions(day, age) {
- let sum = 0;
- if(age >= 0 && age < 123) {
- if (day === "Weekday") {
- sum = age > 18 && age <= 64 ? 18 : 12;
- } else if (day === "Weekend") {
- sum = age > 18 && age <= 64 ? 20 : 15;
- } else if (day === "Holiday"){
- sum = age <= 18 ? 5 : age > 64 ? 10 : 12;
- }
- }
- console.log(sum === 0 ? "Error!" : `${sum}$`);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement