forked from rymdpeter/frontend1-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
43 lines (35 loc) · 982 Bytes
/
app.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
const prompt = require('prompt-sync')();
const subfolders = [
'Variabler',
'if switcher',
'Funktioner'
]
for(let i = 0; i < subfolders.length; i++){
console.log(i + 1 + ". " + subfolders[i])
}
let subfolder = prompt("Välj en modul att köra (1-3): ")
switch(subfolder){
case "1":
console.log("Du har valt " + subfolders[0])
require("./01-variabler/app.js")
break
case "2":
console.log("Du har valt " + subfolders[1])
require("./02-if-switch/app.js")
break
case "3":
console.log("Du har valt " + subfolders[0])
require("./03-funktioner/app.js")
break
default:
console.log("Välj en modul mellan 1-3 ")
}
/* subfolders.forEach(subfolder => {
for(number of subfolder){
console.log(number)
require("./01-variabler/app.js")
require("./02-if-switch/app.js")
require("./03-funktioner/app.js")
return subfolder
}
})*/