 Hi, in this video, we're going to talk about while loop in TypeScript. While loop in TypeScript is a same loop as in many other programming languages. Let's make a simple example in which we're going to use while loop. Next, we need to declare a variable, let's call it i, our variable is going to be number and let's initialize it with zero. Now let's make a while loop and let's put a statement inside it. We're going to say that while i is less than 10, that we want to do something inside our loop. For example, we want to print some text, for example, let's say our number is equal to number i and after each iteration, we want to put one line break in HTML. You can use that by putting this tag and finally, we want to increment our number y, so we're going to say i equals to i plus 1 or you can also put a short form of it by saying e plus plus. It doesn't matter, both these statements work the same, our while statement execute repeatedly until the value of our condition becomes false. And before starting a new iteration, first we need to check our condition. If condition is true, then we're going to execute this code block and if it's false then we're not going to execute the code from this while loop anymore. Okay, now let's compile our TypeScript code to JavaScript. I'm going to use comment prompt. Next, what I need to do is to find my code and my file name is while loop.ts, so we want to compile our TypeScript into JavaScript by typing command tsc and the name of our TypeScript file, I'll press enter. Now our TypeScript file is been compiled and we now have our JavaScript code, which is very similar to our TypeScript. They are almost the same except that our variable i is strongly typed inside TypeScript. Okay, now let's use our JavaScript code inside an HTML file. We want to use our while loop.js inside our HTML and now we're going to test our code to see if our loop works. I want to see a live preview of our HTML code and as you can see we're getting the result of our while loop. It loops 10 times and in each iteration it prints a number, text number with i value, a value of variable i and it loops 10 times until our i variable is greater than or equal to number 10. Let's back to our code. So our while loop is going to execute 10 times our codes starting from number i, which has value 0 at the beginning and in each iteration our number i will have value incremented by 1, so until our i is less than 10, this code block is going to be executed. That's all in this lesson. Thanks for watching. Please don't forget to like this video and please subscribe to my channel. See you in the next video. Bye-bye.