-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript5.js
91 lines (65 loc) · 1.6 KB
/
script5.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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
// introver extrovert
// Human - type
// properties - color weight height
// methods - walk() , talk()
// Vehicle
// properties - regNo , color , model , type
// method - start() , stop()
// bank acc
// properties - accNO , accName , bal
// methods - deposit() , withdrawl()
let a = 10
console.log(a)
console.log(typeof a)
// 10 , -10 ,10.5 , -12.5
let b = true
console.log(b)
console.log(typeof b)
// true or false
let c = "chinmay"
console.log(c)
console.log(typeof c)
//string
// "A", "a", '123', "a123#@$"," "
// comparison operator
console.log(typeof 10)
console.log(typeof '10')
// entity < entity ----> boolean -----> true or false
// < , > ,<= ,>=
// == , != // value
// === , !== // value and type
console.log(10 === '10')
console.log(10 === 10)
console.log(10 == '10')
console.log(10 !== '10')
console.log(10 == 10)
console.log(4 > 3)
console.log(5 < 3)
console.log(2 >= 3)
console.log(3 >= 2)
console.log(2 >= 2)
console.log(2 <= 2)
// logical operator
// AND - &&
// true && true ----- true
// false && true ----- false
// true && false ----- false
// false && false ----- false
console.log(2 == '2' && 3 === 3)
console.log(3 != 3 && 6 == 6)
console.log(7 == 7 && 3 === '3')
console.log(7 == 6 && 3 === '3')
// OR - ||
// true || true ----- true
// false || true ----- true
// true || false ----- true
// false || false ----- false
console.log(2 == '2' || 3 === 3)
console.log(3 != 3 || 6 == 6)
console.log(7 == 7 || 3 === '3')
console.log(7 == 6 || 3 === '3')
// Not - !
//! true ===> false
// !false ===> true
console.log(!(8 === 8))
console.log(! (8 === 7))