Javascript examples for Operator:Boolean Operator
OR operator (||) returns true if one or both expressions are true, otherwise it returns false.
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var x = 6;//from ww w. j a va 2s. c o m var y = 3; document.getElementById("demo").innerHTML = (x === 5 || y === 5) + "<br>" + (x === 6 || y === 5) + "<br>" + (x === 6 || y === 3); </script> </body> </html>