Skip to content

Commit a2f3b26

Browse files
committed
updated 2-initials file with the problem resolution
1 parent 26ca925 commit a2f3b26

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
const firstName = "Creola";
22
const middleName = "Katherine";
33
const lastName = "Johnson";
4+
// const initial = "initials";
5+
// const index = 1;
46

7+
// console.log('The ${Initial} ${index} is ${firstName.charAt(index)}');
58
// Declare a variable called initials that stores the first character of each string.
69
// This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution.
710

8-
const initials = ``;
11+
const initials = firstName[0] + middleName[0] + lastName[0];
12+
console.log(initials);
913

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

0 commit comments

Comments
 (0)