-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComparision-Operator.js
More file actions
50 lines (40 loc) · 981 Bytes
/
Comparision-Operator.js
File metadata and controls
50 lines (40 loc) · 981 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// there are 7 comparision operators that we use in javascript.
// = = [equal to ]
// = = = [equal value and data type]
// ! = [ not equal value]
// > [greater than]
// < [less than]
// >= [greator than and equal to]
// <= [less tahn and equal to]
/* Equal to Comparison Operators */
let x = 24;
let y = 24;
console.log(x==y);
/* Equal value and equal type Comparison Operators */
let x = 21;
let y = '21';
console.log(x === y);
/* Not Equal Comparison Operators */
let x = 82;
let y = 12;
console.log(x != y);
/* Not Equal value or not equal type Comparison Operators */
let x = 22;
let y = 23;
console.log(x !== y);
/* Greater Than Comparison Operators */
let x = 2;
let y = 3;
console.log( x > y);
/* Less Than Comparison Operators */
let x = 2;
let y = 3;
console.log( x < y);
/* Greater Than or Equal To Comparison Operators */
let x = 2;
let y = 3;
console.log( x >= y);
/* Less Than or Equal To Comparison Operators */
let x = 2;
let y = 3;
console.log( x <= y);