Skip to content

Commit 85a4e22

Browse files
committed
update Operator
1 parent 284febc commit 85a4e22

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
8+
<script>
9+
10+
// Arithmetic Operators:
11+
12+
// + (Addition)
13+
// - (Subtraction)
14+
// * (Multiplication)
15+
// / (Division)
16+
// % (Modulus, returns the remainder)
17+
// ++ (Increment by 1)
18+
// -- (Decrement by 1)
19+
20+
x = 10;
21+
y = 3;
22+
23+
result = x + y;
24+
console.log(result)
25+
26+
result = x - y;
27+
console.log(result)
28+
29+
result = x * y;
30+
console.log(result)
31+
32+
result = x / y;
33+
console.log(result)
34+
35+
result = x % y;
36+
console.log(result)
37+
38+
39+
x++ // +1
40+
console.log(x)
41+
y-- // -1
42+
console.log(y)
43+
44+
45+
//Comparison Operators:
46+
47+
//== (Equal to)
48+
//!= (Not equal to)
49+
//> (Greater than)
50+
//< (Less than)
51+
//>= (Greater than or equal to)
52+
//<= (Less than or equal to)
53+
54+
console.log(34==67)
55+
console.log(34<67)
56+
console.log(34>67)
57+
console.log(34<=67)
58+
console.log(34>=67)
59+
console.log(34!=67)
60+
61+
// Logic
62+
console.log(45 == 56 && 78 <= 78)
63+
console.log(45 == 56 || 78 <= 78)
64+
65+
console.log(45 != 56 )
66+
console.log(!(45 != 56))
67+
68+
a = 10;
69+
console.log(a)
70+
71+
// a = a + 10
72+
a +=10
73+
console.log(a)
74+
75+
76+
77+
78+
79+
80+
</script>
81+
82+
</head>
83+
<body>
84+
85+
</body>
86+
</html>

0 commit comments

Comments
 (0)