ProdanTenev

Working Hours

Feb 12th, 2022 (edited)
1,102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 0.53 KB | None | 0 0
  1. function workingTime(input) {
  2.     let hour = Number(input[0]);
  3.     let day = String(input[1]);
  4.     if (10 <= hour && hour <= 18) {
  5.         switch (day) {
  6.             case "Monday":
  7.             case "Tuesday":
  8.             case "Wednesday":
  9.             case "Thursday":
  10.             case "Friday":
  11.             case "Saturday":
  12.                 console.log("open");
  13.             break;
  14.             default:
  15.                 console.log("closed");
  16.                 break;
  17.         }
  18.     } else {
  19.         console.log("closed");
  20.     }
  21. }
Add Comment
Please, Sign In to add comment