forked from truecodersio/JavaScript_Variables
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
40 lines (33 loc) · 1.49 KB
/
app.js
File metadata and controls
40 lines (33 loc) · 1.49 KB
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
console.log("Hello World!\n==========\n");
console.log(
"Follow the steps in the README.md file to complete the exercises:\n==========\n"
);
// Exercise 1
const firstName = "Brandon"; //Instructions say to just declare this variable then assign it in exercise 2, but I can't leave a const variable empty, so I'm assigning it here.
let lastName;
var age;
// Exercise 2
// Instructions say to assign the const variable here, but I can't reassign a const, so I'm leaving that part blank.
lastName = "Holliday";
age = 30;
console.log("Exercise 2: " + firstName + " " + lastName + " " + "age: " + age);
// Exercise 3
let language = "Javascript";
let createdYear = 1995;
let isCaseSensitive = true;
console.log("Exercise 3: " + language + " " + "was created in " + createdYear + " " + "Is it a case sensitive language?" + isCaseSensitive);
// Exercise 4
let price = 19.99;
let isOnSale = false;
let salePercentage = 15;
let stock = 0;
let inStock = false;
let selectedSize = "M";
console.log("Exercise 4: " + "Price:" + price + " " + "Is it on sale?" + isOnSale + " " + "Sale percentage:"+ salePercentage + " " + "Stock:" + stock + " " + "In stock?" + inStock + " " + "Selected Size:" + selectedSize);
// Exercise 5
let title = "Name of the Wind";
let author = "Patrick Rothfuss";
let pageCount = 722;
let bookmark = 456;
let hasRead = true;
console.log("Exercise 5: " + "Title: " + title + " " + "Author: " + author + " " + "Total Pages: " + pageCount + " " + "book mark: " + bookmark + " " + "Have I read it? " + hasRead);