What is the output of the code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

What is the output of the code?

var x=0; while (x<6){ x++; } document.write(x);

1st Dec 2018, 5:52 PM
SIVASANKAR P
SIVASANKAR P - avatar
8 Answers
+ 7
It's 6 because it is delayed increment
1st Dec 2018, 8:17 PM
Unique Sharma
Unique Sharma - avatar
+ 12
Answer is 6
3rd Dec 2018, 11:49 AM
Shubham Kumar
+ 9
6
2nd Dec 2018, 12:35 PM
Mehak Jain
+ 7
I think it's 7.. 😅 Got it... It's 6😐 Damn how did miss that
1st Dec 2018, 6:12 PM
$hardul B
$hardul B - avatar
0
6
3rd Dec 2018, 8:43 PM
Tapiwa Chibindi
Tapiwa Chibindi - avatar
0
0
6th Dec 2018, 7:29 AM
Pankaj Rawat
Pankaj Rawat - avatar
0
Answer is 6
19th Dec 2018, 10:47 AM
Anay
Anay - avatar
0
Ans=6
26th Feb 2019, 9:24 AM
Aaditya Tailor
Aaditya Tailor - avatar