+ 1
JavaScript
Hey guys am having a hard time time spotting the difference between a while loop, do while loop and a for loop.
1 Réponse
+ 3
what exactly don't you understand about them?
see "while" loop is used when you don't know exactly how many times you want to run a loop ,"for" loop is used when you know how many times it will run,
and do{
}while loop
First executes the statement and then condition is checked ,so it always runs atleast one time even if condition is false