forked from Ramshreyas/seqingclojure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathall.js
139 lines (139 loc) · 2.62 KB
/
all.js
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
const fs = require('fileSystem');
const a = 10;
const b = 'hello';
const c = null;
const d = a;
const e = 1 + 2 + 3 + 4;
const f = {
1: 1,
2: 2,
3: 3
};
const g = [
1,
2,
3
];
const h = g[2];
console.log(g[1]);
let a = 2, b = 5;
if (1)
2 + 2;
else if (3)
4;
else if (5 + 5)
6;
else if (7)
8;
x => {
if (is_array_member(form)) {
get_array_member(form);
return 1 + 2;
} else if (is_defn(form))
return get_defn(form);
else if (is_def(form))
return get_const(form);
else if (is_if(form))
return get_if(form);
else if (is_do(form))
return get_do(form);
else if (is_vec(form))
return get_vec(form);
else if (is_lambda(form))
return get_lambda(form);
else if (is_map_ds(form))
return get_map_ds(form);
else if (is_literal(form))
return get_literal(form);
else if (is_operator(form))
return get_operator(form);
else if (is_fn_call(form))
return get_fn_call(form);
else if (true)
return null;
};
x => {
console.log(x);
let a = 2, b = 5;
return console.log(5 + x + a + b);
};
const print_multiple = (x, y, z, a, b, c) => {
if (1 === 1) {
console.log('x :', x);
console.log('y :', y);
return z;
} else {
console.log('a :', a);
console.log('b :', b);
return console.log('c :', c);
}
};
const z = print_multiple(1 + 2 + 3 + 4 + 5 + 6, 'a', true, [
1,
2,
3,
{
'a': 1,
'b': c,
'c': [
1,
2,
{
'x': 10,
'y': [
20,
30
]
},
3
]
}
], null, {
'a': 1,
'b': [
1,
2,
3,
{
'a': 1,
'b': c,
'c': [
1,
2,
{
'x': 10,
'y': [
20,
30
]
},
3
]
}
]
});
const factorial = n => {
if (n === 0)
return 1;
else
return n * factorial(n - 1);
};
console.log('factorial of', a, 'is', factorial(a));
const a = () => {
return 5;
};
console.log(a());
readline();
const a = x => {
console.log(x);
return console.log(1);
};
const b = x => {
console.log(x * x);
return console.log(2);
};
const a = 5, b = 6, c = 1 + 2, d = fun(5, 6, 1 + 2), e = x => {
console.log(x * x);
return console.log(2);
};
mff(mvv, test);