[reported #883] JavaScript Quiz 4, Both 1 and 4 are infinity loops

Because loop 1 is not a infinity loop? Loop 2 is, so you would need to select 2, the third option (or did i get this wrong)?

It works for me.Try it out! This is the code of loop #1:

//1 var i = 1; while(1 < 4) { console.log("loading…"); i = i + 1

The right answer is the fourth one(if you trust the quiz)

Weird, but both 1 and 4 are infinity loops, i will see if this is a known bug. Thank you for letting us know :slight_smile:


You can’t select multiply options? I will make sure this is looked into and fixed.

1 Like

@stetim94 A PR to change those from 1 ==4 to i == 4, etc, in each loop, is in the queue.


Here we go:
1 Is not an infinite loop.
2 Doesn’t run at all.
3 Doesn’t run at all.
4 Is the infinite loop - i < 4 is always true
I don’t really understand how none of you saw that?

1 is an infinity loop, the condition is: 1 < 4, which is always true. it doesn’t say i < 4

Also, the 4th loop is also 1<4, not i<4

Thats what I thought at first but there not i's there 1's

1 Like