I have the following code segment:
var run = 0;
var obj = {'item1':0,'item2':5,'item3':10};
for (var i in obj){
run++
obj['newItem'+run] = 5;
}
return run;
and it returns 3
. But I want it to go on infinitely and eventually crash the browser. Is there any way of updating the obj
variable while in a for loop?