Advertisement
KodingKid

Javascript time + greeting system

Apr 5th, 2021
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (time < 6) { //6am
  2. greeting = "Good morning"
  3. } else if (time < 18) { //6pm
  4. greeting = "Good afternoon"
  5. } else { //before 6am but after 6pm
  6. greeting = "Good night"
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement