Javascript examples for Operator:Boolean Operator
AND operator (&&) returns true if both expressions are true, otherwise it returns false
<!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>