-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalculatingWithFunctions.js
More file actions
77 lines (74 loc) · 1.62 KB
/
Copy pathcalculatingWithFunctions.js
File metadata and controls
77 lines (74 loc) · 1.62 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
function zero(value) {
if (value !== undefined) {
return new Function("return " + "Math.floor(0" + value + ")")();
}
return "0";
}
function one(value) {
if (value !== undefined) {
return new Function("return " + "Math.floor(1" + value + ")")();
}
return "1";
}
function two(value) {
if (value !== undefined) {
return new Function("return " + "Math.floor(2" + value + ")")();
}
return "2";
}
function three(value) {
if (value !== undefined) {
return new Function("return " + "Math.floor(3" + value + ")")();
}
return "3";
}
function four(value) {
if (value !== undefined) {
return new Function("return " + "Math.floor(4" + value + ")")();
}
return "4";
}
function five(value) {
if (value !== undefined) {
return new Function("return " + "Math.floor(5" + value + ")")();
}
return "5";
}
function six(value) {
if (value !== undefined) {
return new Function("return " + "Math.floor(6" + value + ")")();
}
return "6";
}
function seven(value) {
if (value !== undefined) {
return new Function("return " + "Math.floor(7" + value + ")")();
}
return "7";
}
function eight(value) {
if (value !== undefined) {
return new Function("return " + "Math.floor(8" + value + ")")();
}
return "8";
}
function nine(value) {
if (value !== undefined) {
return new Function("return " + "Math.floor(9" + value + ")")();
}
return "9";
}
function plus(value) {
return "+" + value;
}
function minus(value) {
return "-" + value;
}
function times(value) {
return "*" + value;
}
function dividedBy(value) {
return "/" + value;
}
let result = two(times(two()));
console.log(result);