Review Loop (11)


#1

what is the problem in this

for( var s=0 ; s<5 ; i++)
{ cons;ie.log(i);

}
var i=true;

while(i)
{
cons;ie.log("nice");
i=false;
}
var w=false;
do{
cons;ie.log("nice");
w=true;
}
while(w);


#2

@textcoder96915,

The Instructions:
To finish up and prove your loop mastery,
write three syntactically correct loops in the editor:
one for,
one while, and one do. Beware of infinite loops!

the for-loop:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for

the while-loop:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/while

the do-while-loop:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/do...while


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.