Skip to content

Commit 72645b8

Browse files
add function getInitial in 2-initials.js and print to verify
1 parent 168186a commit 72645b8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,9 @@ let initials = ``;
99

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

12+
function getInitial(firstName, middleName, lastName) {
13+
return firstName[0] + middleName[0] + lastName[0];
14+
}
15+
16+
initials = getInitial("Creola", "Katherine", "Johnson");
17+
console.log(`initials is ${initials}`);

0 commit comments

Comments
 (0)