+ 1

Javascript module 3 quiz

Shouldn't the answer be 5? var x=0; while (x<6) { x++; } document.print(x);

13th Dec 2019, 8:42 PM
Pop Rivest
Pop Rivest - avatar
3 Answers
0
It is 6 because loop ends when x is 6.
13th Dec 2019, 9:04 PM
Mystic Life
Mystic Life - avatar
0
The loop is going on for as long as the x is not 6 so it ends exactly when x == 6.
13th Dec 2019, 10:28 PM
Rick Sanchez
Rick Sanchez - avatar
0
Indeed. My confusion
14th Dec 2019, 12:16 AM
Pop Rivest
Pop Rivest - avatar