Copy the example snippet of code & get it to run. Then modify the code so it
includes the message “Good Evening”. Another IF statement should do the trick
however there are several other ways to do the same thing, You may make multiple
versions of the program.
If the time on your browser is less than 10,
you get a “Good Morning” greeting.
Otherwise you will get a “Good day” greeting.
var d = new Date()
var time = d.getHours()
if (time < 10)
This example demonstrates the If…else statement.
Answer by Zoplax
How do you expect to learn if you don’t do your own homework?
Add your own answer in the comments!
There are no revisions for this post.