Code:
var v = new Function("alert(5);");
is exactly the same as
Code:
var v = function() { alert(5); };
It just evaluates the function once rather than multiple times (in your code, the code is evaluated again every time the function is called).
Actually, this won't be exactly equivalent anyway, since the scope of the string code when called by set(Timeout|Interval) is window, while the scope there (by either method) will be the function in which it's evaluated. You could instead do:
Code:
this.timeouts[l].code = Function.call(window, code);
Bookmarks