-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComparisonsOfDataTypes.html
More file actions
76 lines (60 loc) · 1.48 KB
/
Copy pathComparisonsOfDataTypes.html
File metadata and controls
76 lines (60 loc) · 1.48 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Comparisons Of Data Types | JavaScript | Al- Arafat </title>
</head>
<body>
<H1> Assalamualaikum Or-Rohmatullah </H1>
<H2> Al - Arafat </H2>
</body>
<script src="ComparisonsOfDataTypes.js"></script>
<script src="test-4.js"></script>
<script>
// Type-1:
/*
Comparision of Operation:
console.log(2>1);
==> output: True/False
console.log(2<1);
==> output: True/False
console.log(2>=1);
==> output: True/False
console.log(2<=1);
==> output: True/False
console.log(2!=1);
==> output: True/False
console.log("2" >1);
==> output: True/False
console.log("02" >1);
==> output: True/False
console.log(null > 0);
==> output: True/False
console.log(null < 0);
==> output: True/False
console.log(null == 0);
==> output: True/False
console.log(null>=0);
==> output: True/False
[
The reason that an equality check == and comparisons > < >= <= work differently.
comparisons convert null to a number,treating it as 0.
That's why {3} null >=0 is true and {1}null > 0 is false.
]
console.log(undefined >1);
==> output: True/False
console.log(undefined <1);
==> output: True/False
console.log(undefined ==1);
==> output: True/False
*/
/*
===
console.log("2" === 2);
==> output: True/False
console.log(1 == a);
==> output: True/False
*/
</script>
</html>