-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfile16.js
37 lines (29 loc) · 806 Bytes
/
file16.js
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
34
35
"use strict";
// and && operator OR || operator
let myName = "jitendra khadoliya";
let myAge = "20";
// checking 1st condition
// if(myName[0]==="j"){
// console.log("inside if loop");
// }else{
// console.log("inside else loop");
// }
// checking second condition
// if(myAge<= 10){
// console.log("inside if loop");
// }else{
// console.log("inside else loop");
// }
// mearging two condition using and opeartor
// use of && and operator
if(myName[0] === "j" && myAge <=23){
console.log("my name starts with j and age is less the 23");
}else{
console.log("now i am inside the else loop");
}
// use of OR || operator
if(myName[0] === "j" || myAge <=20){
console.log("inside of if loop in OR operator");
}else{
console.log("inside of else loop in OR operator");
}