Why creating custom prototype
functions like:
Array.prototype.clone = function(){
return JSON.parse(JSON.stringify(this));
}
is making them visible when iterating over a for
loop?
It's clear that I have an array
with 7 arrays
inside, but for some reason it is considering all my custom functions when inside the loop. Why? How can I prevent it?
OBS: I am applying to some sort of javascript contest, which takes my algorithm and plays against other players. This loop, is inside the runner, so please consider that changing the way the iterations are processed is not an option.
This is breaking the runner as it tries to execute some code with the columns thinking that my custom function are included on it.
However, looking at their code, I noticed that it is possible to prevent this from happening as they also edit/create Array.prototype
functions.