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