-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
32 lines (30 loc) · 859 Bytes
/
main.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
const { Codestain } = require("./dist/Codestain");
const example = `
const getNumberFromInput = (number) => {
try {
if (number.isInteger()) {
switch (number) {
case 1:
return 1;
break;
case 2:
return 2;
break;
case 3:
return 3:
break;
default:
return -1;
break;
}
} else {
throw Error('Input is not a number.');
}
} catch (e) {
console.error(e);
} finally () {
console.log('Done.');
}
}
`;
console.log(Codestain("JavaScript", example));