-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoperators.js
More file actions
54 lines (40 loc) · 1.23 KB
/
operators.js
File metadata and controls
54 lines (40 loc) · 1.23 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
// Arithmetic Operators
// + - * / % ++ --
// const numberX = 10; // 10 - 4, 6 -4, 2
// const numberY = 4;
// const result = numberX % numberY;
// let counter = 1;
// counter++;
// counter++;
// counter++;
// // console.log(counter)
// let counterMinus = 1;
// counterMinus--;
// counterMinus--;
// counterMinus--;
// Comparison Operator -> Perbandingan ==> Boolean (true/false)
// const x = 1;
// const y = 2;
// const islessThan = x < y;
// console.log(islessThan)
// <, >, <=, >=,
// isEqual -> Value
// const isEqual = 1 == 2; // PROHIBITED
// isNotEqual
// const isNotEqual = 1 != 2; // PROHIBITED
// isStricEqual -> Data Type & Value
// const isEqual = 1 === "1";
// console.log(isEqual)
// const isNotEqual = 1 !== "1";
// Logical Operator
const loginEmail = "indra@devscale.id";
// const emailPassword = "rahasia123";
// const isAdmin = loginEmail === "me@devscale.id" && emailPassword === "rahasia123";
// // console.log(isAdmin)
const emailAdmin1 = "indra@devscale.id";
const emailAdmin2 = "reza@devscale.id";
const emailAdmin3 = "azka@devscale.id";
const isEmailAdmin = loginEmail === emailAdmin1 || loginEmail === emailAdmin2; // -> False
console.log(isEmailAdmin)
// AND -> && -> true && true = true
// OR -> || -> true || false = true