Skip to content

Commit 95a2e5b

Browse files
Completed exercises 1 and 2 in Sprint 2
1 parent 3bba3ba commit 95a2e5b

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
let count = 0;
22

33
count = count + 1;
4-
4+
// Line 3 is using the assignment operator (=) to update the value of `count`.
5+
// It takes the current value of `count` (0), adds 1 to it, and assigns the new value (1) back to `count`.
6+
// This effectively increases the value of `count` by 1.
57
// Line 1 is a variable declaration, creating the count variable with an initial value of 0
6-
// Describe what line 3 is doing, in particular focus on what = is doing

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const 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-
const initials = ``;
8+
const initials = firstName[0] + middleName[0] + lastName[0];
99

1010
// https://www.google.com/search?q=get+first+character+of+string+mdn
11+
console.log(initials);

0 commit comments

Comments
 (0)