-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
111 lines (92 loc) · 2.35 KB
/
Copy pathscript.js
File metadata and controls
111 lines (92 loc) · 2.35 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// 1. comparision operator
// dobule equal ==
// it will give true when value is same it don't check data type.
console.log(8 == 8);
console.log(9 == 8);
console.log(9 == "9");
// Tripal equal ===
// it will give ture coz value & data type is same .
console.log(9 === 9);
//it will give false coz value is same but data type is not same.
console.log(9 === "9");
// not equal !=
console.log(9 != 9);
console.log(9 != 8);
// not equal !==
// check not equal value or not equal type
console.log(9 !== "9");
// > greater then
console.log(9 > 8);
console.log(9 > 10);
// < less then
console.log(9 < 8);
console.log(9 < 10);
// >= greater then equal
// it will be true coz 9 is equal to 9
console.log(9 >= 9);
// it will be true coz 9 is big form 8
console.log(9 >= 8);
// false coz 9 is smaller then 10
console.log(9 >= 10);
// <= less then equal
// false coz 8 is big then 7 it check from left side data thekey right side data is big or small ki na or same
console.log(8 <= 7);
// true
console.log(8 <= 9);
// false
console.log(10 <= 8);
// ? ternary operator (we will learn later)
// 2.logical operators
// && and
// || or
// ! not
// logical && give us boolean value and compair both the data if both data is true then it gives us true result
let x = 9;
let y = 8;
console.log(x > 6);
console.log(y < 6);
console.log(x > 6 && y < 6);
// || or operator
console.log(x > 6);
console.log(y < 6);
console.log(x > 6 || y < 6);
// ! logical not
console.log(x == y); // false
console.log(!(x == y)); // true
// 3. oporator precedence
// B O D M A S
// B = bracket
// O = order
// D = division
// M = multiply
// A = addition
// S = substruction
console.log((36 / 6) * 5 + 2 ** 2 - (5 + 6));
// 6 * 5 + 2 ** 2 - 11
// 6 * 5 + 4 - 11
// 30 + 4 - 11
// 34 - 11
// 23
// 4. Template Literals
const firstName = "Anik";
const lastName = "Ahmed";
const age = 28;
let job = "Web Development";
const countryName = "Bangladesh";
// `` this sign is call Bactic
// `${veriable}`
console.log(
`I a'm ${firstName} ${lastName}, ${age} years old and learning ${job}. `
);
console.log(`my country is ${countryName}`);
// 5. If Else statment
if (5 > 3) {
console.log("if its true please execue this line ");
} else {
console.log("if its false please execue this line ");
}
if (5 < 3) {
console.log("if its true please execue this line ");
} else {
console.log("if its false please execue this line ");
}