Skip to content

Commit 982f3b3

Browse files
committed
exercise: implement string indexing for initials
1 parent 9be9270 commit 982f3b3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sprint-1/exercises/initials.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ let lastName = "Johnson";
44

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.
7+
8+
const initial = firstName.charAt(0) + middleName.charAt(0) + lastName.charAt(0);
9+
console.log( `acronym = ${initial}`);

0 commit comments

Comments
 (0)