Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>6</title>
- </head>
- <body>
- <script>
- // ex 1 the AND operator
- var a = 123, b = 123, c = "123",d = "123";
- if (a === d && c === b)
- {
- document.write("ex1 a equals b and c equals d");
- }
- else
- {
- document.write("ex1 a doesnt equal b and c doesnt equal d");
- }
- // ex 2 the OR operator " || "
- var e = 123, f = 123, g = "123",h = "123";
- if (e === g || g === h)
- { // if one is true it ill execute the if
- document.write("<br><b>ex2 e equals f and g equals h</b>");
- }
- else
- {
- document.write("<br>ex2 either e doesnt equal f or g doesnt equal h");
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment