+ 1

How can you explain it ??

Here is the code, the output will be 16. I can't understand how the output is becoming 16 ??? for (i = 0; i <= 10; i++) { if (i == 5) { continue; } document.write(i + "<br />"); }

18th Aug 2017, 9:26 AM
Abdusamad Abdurashidkhonov
Abdusamad Abdurashidkhonov - avatar
4 Answers
+ 2
Output should be several lines with values from 0 to 4 and from 6 to 10. Probably the bug in some other place in the code.
18th Aug 2017, 9:30 AM
Roman
Roman - avatar
+ 8
i agree with Roman, i did try to see the output of this code and it was a several number from 0 to 4 and 6 to 10. You have to see your code again it must be a bug in somewhere that you didn't realise
18th Aug 2017, 11:35 AM
Ouafae Kandoussi
Ouafae Kandoussi  - avatar
+ 4
use a visualizer if you not sure how the code is executing it helps with for loops.
18th Aug 2017, 9:34 AM
D_Stark
D_Stark - avatar
+ 1
thanks
19th Aug 2017, 2:32 AM
Abdusamad Abdurashidkhonov
Abdusamad Abdurashidkhonov - avatar