Code for checking current hours for custom greetings does not work for javascript. How to fix? [closed]

if (hourNow > 18) greeting = "Good Evening. Whenever inspected for problems, it says “Uncaught Reference Error: hourNow is not defined”. The code is supposed to check your current time to make a custom greeting based on what hour you have checked the file.