Skip to content

Commit 59015fe

Browse files
committed
complete key-exercise 2
1 parent 734bd1a commit 59015fe

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ const firstName = "Creola";
22
const middleName = "Katherine";
33
const lastName = "Johnson";
44

5+
56
// Declare a variable called initials that stores the first character of each string.
67
// This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution.
78

8-
const initials = ``;
9+
const initials = `${firstName.charAt(0)}${middleName.charAt(0)}${lastName.charAt(0)}`;
10+
11+
console.log(initials)
912

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

0 commit comments

Comments
 (0)