+ 4
Java script
Var x=1 If(x<2) Document.write(x) Else Document.write(++x) The result here is 1? I got the challenge the result 1 is wrong, and the right answer is 12 , why?
8 Réponses
+ 3
Your welcome... Do ask if you have any doubt... I am always happy to help...😊😊😊
+ 6
Each time you writez it is appended to the screen..
First it checks if x < 2, it is so it writes 1.
Then it writes x+1 which is 2.
So the final result is 12
NOTE
There is no else statement
correct question
Var x=1
If(x<2)
Document.write(x)
Document.write(++x)
+ 4
There is no else statement... in challenge...
but u wrote it in question
First it writes 1 then writes 2
+ 3
Please post the screenshot of the challenge question
+ 3
thank u very much 🙏🏼
+ 1
I don't know how to insert pic here, but I put it in my profile
+ 1
what is the write result, I don't understand 👀
+ 1
thank you 👍🏼💚