+ 1
Can someone explain this code to me?
var i = 3; var k = 0; for(var j = 0; j<Math.pow(i,3);j++){ k++; //k=k*10; } document.write(k);
4 Respostas
+ 4
OK.. initially the value of i=3 so by executing the condition Math.pow(i,3) the limit value become 27 (3^3) then the working of loop is Just as like work of for loop.. Don't get confused with the statement //k=k*10 it's Jus a statement so it won't consider for execution.. so after completing the loop the value become 27
+ 2
26??
0
@Vignesh
No
27
0
Oh wait. I was so confused I get 9 from pow(3,3). My mistake. Thank you @Vignesh.