-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4-operators.html
68 lines (50 loc) · 1.76 KB
/
4-operators.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>javaScripts operators</title>
</head>
<body>
<script>
/* //operators:
befor understanding operator first understansd operand:
operand= entities in which operators operate
example: 3+5=8 ( in this example the 3 and 5 are operand and the plus sign(+) is operator)
some operators are :
1: unary operator:
it has single operand
example x=-x (in which only one operator which is "x")
2: binary: it has more then one operands.
example: a=b+c
3: Arithmatic operators:
arithmatic operators are : plus(+),negative(-),divide(/),multiply(*),modulas(% which mean reminder of any division),exponention(**),increment(++),decrement(--)
4: Assignment operators:
asssignment operators are: (=),(+=),(*=),(**=)
5: String operators:
the plus(+) operator can also be used for concatenation string.
6:Comparision Operators:
Comparision operators are: equal to(==),equal value and equal type(===),not equal(!=),grater then and equal(>=),ternary operator (?).
7: Logical operators:
AND(&&),OR(||),NOT(!)
8: type operator:
1: typeof(return the type of variable )
2: instanceof(instance of an object type)
9: bidwise Operator:
*/
// some programs practices using operators:
let a=7;
let b=7;
let d=4;
c=a+b;
d+=b; //we can also write d=d+b;
console.log(c);
console.log(d);
console.log(a++);
console.log(a+b);
console.log(a--);
console.log(a+=b);
</script>
</body>
</html>