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

bug-reported
javascript

#1


#2

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)?


#3

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

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


#4

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


#5

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


#6

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


#7

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?


#8

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


#9

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


#10

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