Skip to content

Commit a040e64

Browse files
committed
Declared initials variable to take 1st letters
1 parent fbabe03 commit a040e64

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

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

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

5-
// Declare a variable called initials that stores the first character of each string.
6-
// 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 initials = ``;
9-
10-
// https://www.google.com/search?q=get+first+character+of+string+mdn
5+
const initials = `${firstName[0]}${middleName[0]}${lastName[0]}`;
6+
console.log(initials);

0 commit comments

Comments
 (0)