Skip to content

Commit 909a41e

Browse files
committed
Add function to capitalize first letter of a name
1 parent 60f2cf6 commit 909a41e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

prep/example2.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
function capitaliseFirstLetter(name) {
2+
return (name[0].toUpperCase() + name.substring(1));
3+
}
4+
5+
function createGreeting(name) {
6+
const result = capitaliseFirstLetter(name);
7+
return `Welcome ${result}`;
8+
}
9+
10+
const greeting = createGreeting("barath");
11+
console.log(greeting);

0 commit comments

Comments
 (0)