Answers for "example of while loop in javascript with array length"

1

example of while loop in javascript with array length

var soccerTeams = ['Barca','Madrid','Gunners','City','PSG']
var x=0;

while( x <= soccerTeams.length) {
  console.log(soccerTeams[x])
  x++;
}

======== output ===========
Barca
Madrid
Gunners
City
PSG
undefined
5
Posted by: Guest on February-12-2020

Code answers related to "example of while loop in javascript with array length"

Code answers related to "Javascript"

Browse Popular Code Answers by Language