Skip to content

Commit 21aec41

Browse files
committed
created an output of string with initial CKJ, outputed in the console
1 parent 577235d commit 21aec41

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ let lastName = "Johnson";
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

88
let initials = ``;
9+
let firstNameInitials = firstName.charAt(0);
10+
let middleNameInitials = middleName.charAt(0);
11+
let lastNameInitials = lastName.charAt(0);
12+
initials= `${firstNameInitials}${middleNameInitials}${lastNameInitials}`
13+
console.log(initials);
914

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

0 commit comments

Comments
 (0)