so in this blog we will learn about the while and do while loop of javascript
here are the codes as follows
// while loop in javascript
let n=prompt("enter the value of n")
n=Number.parseInt(n)
let i=0;
// while (i<n){
// console.log(i)
// i++;
// }
// do while loop in javascript
do{
console.log(i)
i++;
}while(i<n)
Comments
Post a Comment