Skip to content

Commit 7b32515

Browse files
committed
comp
1 parent 37283e6 commit 7b32515

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

10comparision.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// comparision ==> boolean
2+
3+
console.log(2>=1, 2==1, 2>='1', true==1, ''==false); // comprision & typecast
4+
5+
let res = 1=='1' // Boolean variable
6+
console.log(res)
7+
8+
console.log('Z' > 'a', 'Hello' == 'hello', 'Hell' < 'Hello') // ascii value & ascii weightage
9+
console.log('Hello ' > 'Hello', 'Hello ' == 'Hello'); // output --> true, false : strlen of space
10+
11+
// Strict Equality
12+
console.log('1'==='1', 1==='1')
13+
14+
// Special null
15+
console.log(null==0, null>0, null>=0)
16+
17+
// undefined
18+
console.log(undefined>=0, undefined==0);
19+
20+
// note: undefined & null points each other
21+
console.log(undefined==null);

0 commit comments

Comments
 (0)