Javascript – Program function in time

I need to write a code in javascript that works 24/7 and constantly detects if today is (for example) Wednesday at 10.00pm, and executes every Wednesday at 10pm (calls a function inside the script) Can you help me with that? I’m still learning JS