+ 1
Java Script-
Could you help me to understand it; What is the output of this code? var x='2'; if (x+2==4) { document.write(x+5); else { document.write(x+4); } Answer: 24
2 RĂ©ponses
+ 1
Here x is a string
In Js a string + a number is string
i.e '2'+2='22'
And '2' + 4 = '24'
0
I understand. Thank you :)