+ 1
Please Explain this. Confused me.
var arr =[1,2,3,4]; var ct = arr.length; for( var i=0;i<ct;i++){ ct--; arr[i]+=i; } document.write(arr);//1,3,3,4
1 Resposta
+ 1
I think the loop runs two times.
var arr =[1,2,3,4]; var ct = arr.length; for( var i=0;i<ct;i++){ ct--; arr[i]+=i; } document.write(arr);//1,3,3,4