-
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathlogicalOperator.js
More file actions
34 lines (26 loc) · 764 Bytes
/
logicalOperator.js
File metadata and controls
34 lines (26 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//AND NOR NOT
// ================== AND ===================
let age = 18;
//Both the conditions should be true to get executed
if(age > 13 && age < 19){
console.log("You are a teenager");
}else{
console.log("You are not a teenager");
}
//=================== OR ===================
let myName = "Kaiwalya";
//Any one should be true
if(myName =="kaiwalya" || myName === "Kaiwalya"){
console.log("Name matched !!");
}else{
console.log("No match found");
}
//=================== NOT ===================
//This is used to invert the given inputDescEl
let amIaTeenAger = true;
//This is equivalent to if(amIaTeenAger == false){}
if(!amIaTeenAger){
console.log("You are not a teenager");
}else{
console.log("You seem to be a teenager")
}