Skip to content

Commit 84d4de9

Browse files
completed exercises 1 and 2 of section 1
1 parent 733c53e commit 84d4de9

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

Sprint-1/1-key-exercises/1-count.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ count = count + 1;
44

55
// Line 1 is a variable declaration, creating the count variable with an initial value of 0
66
// Describe what line 3 is doing, in particular focus on what = is doing
7+
8+
//Answer: Line 3 is updating the value of the count variable by 1 to the current value of count.
9+
// The = operator reassigns the value of count to be equal to (count + 1), which is the current value of count plus 1.
10+
//This creates a counter that always increases by an increment of 1.

Sprint-1/1-key-exercises/2-initials.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ let lastName = "Johnson";
55
// Declare a variable called initials that stores the first character of each string.
66
// This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution.
77

8-
let initials = ``;
9-
8+
let initials = firstName[0] + middleName[0] + lastName[0];
9+
console.log("The initials are:", initials);
1010
// https://www.google.com/search?q=get+first+character+of+string+mdn
11-

0 commit comments

Comments
 (0)