DEV Community

Pardip Lal
Pardip Lal

Posted on

How to loop array using while loop ?

let arr = ["apple", "mango", "potato", "banana"];
let ind = 0;
while(arr[ind]){
console.log(arr[ind]);
ind++;
}

Top comments (0)