Let's continue on the process of looping the previous video you talk about for Loop.
And we have one type which is called the Y loop.
So they are based on the same logic but a syntax which differs.
So let me comment out this one and the next one I'm going to be asked next loop.
Loop number two is called do y a y loop.
Sorry, is y.
While.
Loop.
So what it centers the wild loop is similar to the for loop, but instead of using an initialize and
an incremental, it is only or it has a condition only.
The code block is executed repeatedly until the condition evaluates to false.
So while loop don't have initialize, it doesn't have incremental.
So why?
How can you write that?
So let's save it.
And now let's write a syntax for why we bring in while in the parentheses like that they might carry
braces.
So here we declare a variable.
Let's I let's I equal to zero up here.
So inside my wild loop is my condition.
So if I is less than ten then the code here is going to run.
Then we can cancel that log.
Consulate log the I.
So if I save this one, our application is going to crash or freeze because it's going to be always
true.
Always to want to run round, round, round, round, round, round, round, round until our browser
cannot hold the data anymore.
So to avoid that, we are going to increment the value down here.
So I'm going to make it plus plus I meaning we are increasing I at every loop so that this condition
can be forced at any point in time.
So if I save it now, I have some syntax error so I need to make it a is I but not I mean one.
So we see that I have 0 to 9 because the same process I add for this one, it has no initialize, it
has no incremental, but it has a condition that is y loop.
So depending how you want it, then you can go for for loop or while loop.
But for loop is commonly used because that one is more flexible.
And for that one tool, we can make it to this sentence, which is more flexible than the while, but
all of them depends on the logic of your application.
So that's differences between the for loop and wild loop.
The next video, let's talk about one loop, which is also called the Y.
I mean, I think, yeah, we have many of but I think we have this tool.
All right.
So we just had a basic loop that we come across as we move on.
We'll be exploring more of the loops.