0

Can someone tell me what I'm doing wrong here please? I'm still at a very basic level.

https://code.sololearn.com/W4GFcnwU6b2M/?ref=app

1st May 2017, 10:38 PM
Harry
Harry - avatar
3 Antworten
+ 5
on first line you declare var x=3, and you again declare var x="hello" :) so the value of x is "hello", that's last :) and hello is not grater than 4, hello is string.
1st May 2017, 11:07 PM
Nikola Stojiljkovic
Nikola Stojiljkovic - avatar
+ 3
you have already assigned x as an integer 3, then you modified it a changed it into a string . you need to change the name of the variable of x
1st May 2017, 10:49 PM
Abdelaziz Abubaker
Abdelaziz Abubaker - avatar
+ 2
try this: function myFunction() { var xx = 3; var y = 4; var x = "hello" if (xx < y) { document.getElementById("hi").innerHTML=x; } }
1st May 2017, 10:49 PM
Abdelaziz Abubaker
Abdelaziz Abubaker - avatar