+ 1

why output is that. somebody can explain this?Please

var x=""; for(i=0;i<3;i++) { x+=i+"<br>"} document.write(x); output; = 0 0 1 0 1 2

21st Sep 2016, 10:03 AM
sagir
sagir - avatar
4 Réponses
+ 3
" x += i + <br> " means "x = x + i + <br>". So your output is like; 0<br> //First 0<br>1<br> //Second 0<br>1<br>2<br> //Third Etc.
21st Sep 2016, 3:55 PM
Rhealdrin
0
this is also my output. I ask that; why it is
21st Sep 2016, 12:38 PM
sagir
sagir - avatar
0
@Sayme answered your question perfect.
21st Sep 2016, 5:22 PM
Amir Rahimimorad
Amir Rahimimorad - avatar
0
Thanks all
21st Sep 2016, 8:16 PM
sagir
sagir - avatar