do while loop typescript code example
Example 1: typescript while
var n: number = 5;
while (n > 5) {
console.log("Entered while : " + n);
n++;
}
do {
console.log("Entered do…while : " + n);
n++;
}
while (n > 5)
Example 2: typescript while
let i: number = 2;
while (i < 4) {
console.log( "Block statement execution no." + i )
i++;
}