Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript If-Else Statement</title> </head> <body> <script> var now = new Date(); var dayOfWeek = now.getDay(); // Sunday - Saturday : 0 - 6 if(dayOfWeek == 5) { document.write("Have a nice weekend!"); } else { document.write("Have a nice day!"); } </script> </body> </html>