Bool

Hello!
Is with x==8 answer authomatically “set” to bool?

<!DOCTYPE html>
<html>
<body>

<p>Given that x=5, return the value of the comparison x==8.</p>
<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction()
{
var x=99;
document.getElementById("demo").innerHTML=x==8;
}
</script>

</body>
</html>

This looks like homework. Did you try your demo page in a browser to see what happens? :slight_smile:

Yes. I am complete beginner. We never said it shoudl be bool, it "concluded " it automatilaccly, obviously…didnt it???

I mean, we never wrote word “bool” in this example, but it “knows” it should be written true or false…itis from w3school…i tried…

Don’t take this the wrong way, but don’t you think it might be an idea to read up on some of the basics first?

W3Schools is not the best place to learn JavaScript.
Try this, [URL=“http://htmldog.com/guides/javascript/beginner/”]this or [URL=“http://eloquentjavascript.net/”]this instead:

Also, does it help to think of your code like this:

var x=99;
document.getElementById("demo").innerHTML=(x===8);
=> false

document.getElementById("demo").innerHTML=(x===99);
=> true