Skip to content

Commit 05b468c

Browse files
solving the exercise
1 parent 1e2d9f3 commit 05b468c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

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

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

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

8-
const initials = ``;
10+
const initials = `${firstName.charAt(0)}${middleName.charAt(0)}${lastName.charAt(0)}`
911

1012
// https://www.google.com/search?q=get+first+character+of+string+mdn
13+
14+
15+
console.log(initials)

0 commit comments

Comments
 (0)