forked from benrbryant/JavaScript_Functions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
24 lines (23 loc) · 641 Bytes
/
app.js
File metadata and controls
24 lines (23 loc) · 641 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
console.log("Hello World!\n==========\n");
// Exercise 1 Section
console.log("EXERCISE 1:\n==========\n");
function printOdds(count) {
for (let i = 1; i < count; i++) {
if (i % 2 == 1) {
console.log(i);
} else {
continue;
}
}
}
// Exercise 2 Section
console.log("EXERCISE 2:\n==========\n");
function checkAge(age, userName) {
let aboveSixteen = `Congrats ${userName}, you can drive!`;
let belowSixteen = `Sorry ${userName}, but you need to wait until you're 16.`;
if (age >= 16) {
console.log(aboveSixteen);
} else {
console.log(belowSixteen);
}
}