When trying to write a for loop that displays each item in that order without writing alerts () for each item?

advertisements

Do the D A N C E 1 2 3 4 5 Stick to the B E A T Get ready to ignite

So I am trying to write a for loop that alerts each item above in that order without having to write alert() for each of them. I don't know exactly how to approach this but this is what I have for now:

var dance = ["Do the", "D", "A", "N", "C" "E", "1", "2", "3", "4", "5", "Stick to the ", "B", "E", "A", "T", "Get ready to ignite"];
for (var i= 0, i < dance.length; i += 1) {
    alert(dance[i]);
}

But I'm pretty sure my code is wrong. Is there anything I didn't add to my code? What exactly is wrong?


Assuming you are having difficulties running this code, it will not run because there is a comma missing after the "C".

var dance = ["Do the", "D", "A", "N", "C" "E", "1", "2", "3", "4", "5", "Stick to the ", "B", "E", "A", "T", "Get ready to ignite"];

should be

var dance = ["Do the", "D", "A", "N", "C", "E", "1", "2", "3", "4", "5", "Stick to the ", "B", "E", "A", "T", "Get ready to ignite"];