next ... I have a code, and I want it to do a certain action every day at a specific time.
As I am learning JS, I believe I have to use a loop for this (I don't know), but I would like your help.
My code:
data = new Date
horas = data.getHours()
minutos = data.getMinutes()
if(horas === 11){
console.log('Okay!')
}
In this code (which is in the node), it only prints "okay" and rightly if I'm running at 11am. How do I run the code and only print it when the time is right? Example:
I execute the code at 11 am, but with the condition of if getHours () === 12, how can I make it print at the terminal when it is 12 pm?