Advertisement
Guest User

Untitled

a guest
May 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. enum Weekday {
  2. Monday,
  3. Tuesday,
  4. Wednesday,
  5. Thursday,
  6. Friday,
  7. Saturday,
  8. Sunday
  9. }
  10. namespace Weekday {
  11. export function isBusinessDay(day: Weekday) {
  12. switch (day) {
  13. case Weekday.Saturday:
  14. case Weekday.Sunday:
  15. return false;
  16. default:
  17. return true;
  18. }
  19. }
  20. }
  21.  
  22. const mon = Weekday.Monday;
  23. const sun = Weekday.Sunday;
  24. console.log(Weekday.isBusinessDay(mon)); // true
  25. console.log(Weekday.isBusinessDay(sun)); // false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement