Say I have the following JavaScript code (in global context):
var t = setTimeout(f, a); // f is an arbitrary function, a an arbitrary timeout
One can now cancel the set timeout:
clearTimeout(t);
But is it also possible to execute the timeout prior to it normally firing?
E.g.:
var func = getFunctionFromTimeout(t); // Does a function like this exists?
clearTimeout(t);
func();
or
executeAndClearTimeout(t); // Does this one?
I don’t think such a function exists… but you’re allready saving
t, why not savefas well?