11. Review - Why am I getting an infinite loop?



My code is creating an infinite loop. I reviewed it, but can't find the problem. Help is appreciated!

var array007 = ["Penn", "Michelle", "Kimberly", "Amber"]

for(i=0; i< i + array007.length; i++) {
    console.log("Slim Shady is here with his homie" + array007[i])
var jimmyJohns = true

var dominos = function() {
    while (jimmyJohns) {
        console.log("Dominos beats Jimmy Johns.")
        jimmyJohns = false


var pizzaHut = false

do {
} while (pizzaHut);


This is the thing that stops your loop:

i < i + array007.length

When do you expect that it will be false?


Hey Albion, thanks for replying to my question.

You're right, i < array007.length for this to work.



This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.