JAVASCRIPT BOOLEAN


Booleans in javascript are used to return either two values true or false.

Operator == in javascript

== operators in javascript return true if both the given datas are equal else it returns false.
<!DOCTYPE html>
<html>
<head>
<title>
JAVASCRIPT
</title>
</head>
<body>
<p id="output">
</p>
<script>
document.getElementById
("output").innerHTML= 180==180;
</script>
</body>
</html>

Output:

Operator > in javascript

Operator > returns true if number on left hand side is greater than number on right hand side else it returns false.
<!DOCTYPE html>
<html>
<head>
<title>
JAVASCRIPT
</title>
</head>
<body>
<p id="output">
</p>
<script>
document.getElementById
("output").innerHTML= 180>18;
</script>
</body>
</html>

Output:

Operator < in javascript

Operator < in javascript returns true if number on left handside is less than number on right hand side else it returns false.
<!DOCTYPE html>
<html>
<head>
<title>
JAVASCRIPT
</title>
</head>
<body>
<p id="output">
</p>
<script>
document.getElementById
("output").innerHTML= 180<18;
</script>
</body>
</html>

Output: