Is there anything readily available in JavaScript (i.e. not through "plugins") that allows me to do something like setTimeout
, but instead of saying in how many milliseconds something should happen, I give it a date object telling it when to do something?
setToHappen(function () {
alert('Wake up!');
}, new Date("..."));
And yes, I know I can do this by simply subtracting new Date()
with my existing date object (or maybe it's the other way around) to get the amount of milliseconds, but I'd still like to know.