-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
50 lines (36 loc) · 944 Bytes
/
index.js
File metadata and controls
50 lines (36 loc) · 944 Bytes
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
/*
arithmetic operators = operands (values, variables, etc..)
operators(+,-,*,/)
ex. 11 = x + 5;
*/
let students = 30;
// students = students - 1;
// students = students + 1;
//students = students * 2;
// students = students / 2;
// students = students ** 2;
// students = students % 2;
// students -= 1;
// students += 1;
//students += 2;
// students /= 2;
// students **= 2;
// students %= 2;
// students += 1;
//students++;
//students--;
/*
operators precedence
1. parenthesis ()
2. exponents
3. multiplication & division & modul0
4. addition & subtraction
*/
// console.log(students);
// equation 1
// let result = 1 + 2 * 3 + 4 ** 2; // 1 + (2 * 3) + (4 ** 2); // 1 + 6 + 16 = 23
// equation 2
// let result = 12 % 5 + 8 / 2; // (12 % 5) + (8 / 2); // 2 + 4 = 6
// equation 3
let result = 6 / 2 ** (2+5); // 6 / 2 ** 7; // 6 / 128 = 0.046875
console.log(result);