Logical Operators tutorial in JavaScript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Logical Operators JavaScript</title>
<script>
var age = 20;
var age2 = 33;
if (age >= 18 && age <= 21) {
console.log("Yes you are eligible");
}
if (age >= 30 && age <= 32) {
console.log("Yes you are eligible");
}
if (age >= 18 || age <= 21) {
console.log("Yes you are eligible");
}
if (age >= 30 || age <= 32) {
console.log("Yes you are eligible");
}
if (!age >= 18) {
console.log("Yes age is greater than 18");
}
console.log(age >= 13);
console.log(!age >= 13);
</script>
</head>
<body>
</body>
</html>
.png)
.png)
.png)
.png)
.png)
.png)
Comments
Post a Comment