Skip to content

Commit 198f1ae

Browse files
committed
2-initials.js
1 parent b949792 commit 198f1ae

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ count = count + 1;
66

77
// Line 1 is a variable declaration, creating the count variable with an initial value of 0
88
// Describe what line 3 is doing, in particular focus on what = is doing
9-
//Line 3 is reassigning variable count with a new value, in this case we're saying add 1 to whatever we already have in count, and so by using the console.log before and after the reassignment the we can tell new value of count is 1
9+
10+
/*Line 3 is reassigning variable count with a new value, in this case we're saying add 1 to whatever we already have in count,
11+
and so by using the console.log before and after the reassignment the we can tell new value of count is 1
12+
*/

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ 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 = ``;
8+
9+
// let initials = `${firstName.slice(0,1)}${middleName.slice(0,1)}${lastName.slice(0,1)}`;
10+
let initials = `${firstName.charAt(0)}${middleName.charAt(0)}${lastName.charAt(0)}`;
911

1012
// https://www.google.com/search?q=get+first+character+of+string+mdn
1113

14+
console.log(initials);

0 commit comments

Comments
 (0)