nick34992
3/11/2017 - 9:00 PM

JavaScript While Loop: Iterate through Bands List

JavaScript While Loop: Iterate through Bands List

var bands= ['', 'The Cure', 'The Who', 'The Four Seasons', 'Radiohead', 
            'The Velvet Underground', 'Grateful Dead', 'Nirvana', 
            'The Rolling Stones', 'Green Day', 'Linkin Park'];
var i = 1;

do {
    console.log('Band #' + i + ' is ' + bands[i]);
    i++;
} while (i < bands.length);