AND operator (&&) returns true if both expressions are true, otherwise it returns false - Javascript Operator

Javascript examples for Operator:Boolean Operator

Description

AND operator (&&) returns true if both expressions are true, otherwise it returns false

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

<script>
var x = 6;//from w  w w  .  j  a v a2 s .  c o  m
var y = 3;

document.getElementById("demo").innerHTML = (x < 10 && y > 1) + "<br>" + (x < 10 && y < 1);
</script>

</body>
</html>

Related Tutorials