0
Can someone tell me what I'm doing wrong here please? I'm still at a very basic level.
3 ответов
+ 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.
+ 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
+ 2
try this:
function myFunction() {
var xx = 3;
var y = 4;
var x = "hello"
if (xx < y) {
document.getElementById("hi").innerHTML=x;
}
}