Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript If-Else Statement</title> </head> <body> <script> let now = new Date(); let 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>