Advertisement
Liliana797979

working time

Dec 9th, 2020
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function workingtime(arg1, arg2) {
  2.     let hour = Number(arg1);
  3.     let day = arg2;
  4.  
  5.     if (hour >= 10 || hour <= 18) {
  6.         switch(day) {
  7.             case "Monday":
  8.             case "Tuesday":
  9.             case "Wednesday":
  10.             case "Thursday":
  11.             case "Friday":
  12.             case "Saturday":
  13.                 console.log(`open`);
  14.                 break;
  15.                 default:
  16.                     console.log(`closed`);
  17.                     break;
  18.         }
  19.     }
  20. }
  21.  
  22.  
  23. workingtime("11", "Weekend");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement