Skip to content

Commit 6afaba2

Browse files
committed
Declared initials with 'let' statement inside function.
1 parent ebaef49 commit 6afaba2

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,12 @@ let firstName = "Creola";
55
let middleName = "Katherine";
66
let lastName = "Johnson";
77

8-
98
function getInitials() {
10-
return `${firstName[0]}${middleName[0]}${lastName[0]}`;
9+
let initials = `${firstName[0]}${middleName[0]}${lastName[0]}`;
10+
return initials;
1111
}
1212

13-
console.log(getInitials());
13+
console.log(getInitials());
1414

1515
// Export the initials for testing instead of returning at top-level
1616
module.exports = getInitials;
17-
18-
19-

0 commit comments

Comments
 (0)