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
59 lines (52 loc) · 2.96 KB
/
app.js
File metadata and controls
59 lines (52 loc) · 2.96 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
console.log("Hello World!\n==========\n");
console.log(
"Follow the steps in the README.md file to complete the exercises:\n==========\n"
);
// Exercise 1: Declaring Variables
// Steps are to be completed in the app.js file.
// 1. Declare a variable named lastName using the let keyword
let lastName;
// 2. Declare a variable named age using the var keyword
var age;
// Exercise 2: Assigning Values to Variables
// Steps are to be completed in the app.js file.
// 1. Declare a const named firstName and assign it to a string that's your first name.
const firstName = "Corey";
// 2. Assign your last name as the string value to the variable lastName
lastName = "Schroeder";
// 3. Assign your age as the number value to the variable age
age = 34;
// Exercise 3: Declaring and Assigning Values to Variables
// Steps are to be completed in the app.js file.
// 1. Declare a variable named language using the let keyword, and assign it the value "JavaScript" (string)
let language = "JavaScript";
// 2. Declare a variable named createdYear using the let keyword, and assign it the value 1995 (number)
let createdYear = 1995;
// 3. Declare a variable named isCaseSensitive using the let keyword, and assign it the value true (boolean)
let isCaseSensitive = true;
// Exercise 4: Declaring and Assigning Values to Variables x2
// Steps are to be completed in the app.js file.
// 1. Declare a variable named price using the let keyword, and assign it the value 19.99 (number)
let price = 19.99;
// 2. Declare a variable named isOnSale using the let keyword, and assign it the value false (boolean)
let isOnSale = false;
// 3. Declare a variable named salePercentage using the let keyword, and assign it the value 15 (number)
let salePercentage = 15
// 4. Declare a variable named stock using the let keyword, and assign it the value 0 (number)
let stock = 0;
// 5. Declare a variable named inStock using the let keyword, and assign it the value false (boolean)
let inStock = false;
// 6. Declare a variable named selectedSize using the let keyword, and assign it the value "M" (string)
let selectedSize = "M"
// Exercise 5: Declaring and Assigning Values to Variables x3
// Steps are to be completed in the app.js file.
// 1. Declare a variable named title using the let keyword, and assign it the value "Name of the Wind" (string)
let title = "Name of the Wind"
// 2. Declare a variable named author using the let keyword, and assign it the value "Patrick Rothfuss" (string)
let author = "Patrick Rothfuss";
// 3. Declare a variable named pageCount using the let keyword, and assign it the value 722 (number)
let pageCount = 722;
// 4. Declare a variable named bookmark using the let keyword, and assign it the value 456 (number)
let bookmark = 456;
// 5. Declare a variable named hasRead using the let keyword, and assign it the value true (boolean)
let hasRead = true;