Check out example codes for "typescript while". It will help you in understanding the concepts better.

Code Example 1

let i: number = 2;

while (i < 4) {
    console.log( "Block statement execution no." + i )
    i++;
}

Learn ReactJs, React Native from akashmittal.com