I've made a little method to easily repeat a function several times (instead of using loops, cause they are long and tiring, at least for me).
Function.prototype.repeat = function(count,params) {
while(count--) this.apply(this, params);
};
document.write.repeat(4,["Hi"]);
I expected it to execute nicely and write it properly. Well, in the line of the while
loop, there was an error!!
Uncaught TypeError: Illegal invocation.
Any ideas about what could cause that?