-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
42 lines (37 loc) · 1.09 KB
/
script.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
const topics = ['HTML', 'CSS', 'Git', 'JavaScript'];
const randomTopic = topics[Math.floor(Math.random() * topics.length)];
/*
if (topic === 'HTML') {
console.log("Let's study HTML!");
} else if (topic === 'CSS') {
console.log("Let's study CSS!");
} else if (topic === 'Git') {
console.log("Let's study Git!");
} else if (topic === 'JavaScript') {
console.log("Let's study JavaScript!");
} else {
console.log('Please try again!');
}
*/
function listTopics() {
for (let x = 0; x < topics.length; x++) {
console.log(topics[x]);
}
}
function selectTopic() {
if (randomTopic === 'HTML') {
console.log("Let's study HTML!");
} else if (randomTopic === 'CSS') {
console.log("Let's study CSS!");
} else if (randomTopic === 'Git') {
console.log("Let's study Git!");
} else if (randomTopic === 'JavaScript') {
console.log("Let's study JavaScript!");
} else {
console.log('Please try again!');
}
}
console.log('Here are the topics we learned through Prework:');
listTopics()
console.log('Which topic should we study first?');
selectTopic()