Skip to content

Commit 81ae2ac

Browse files
committed
Refactor capitalize function and simplify code
1 parent c229426 commit 81ae2ac

File tree

1 file changed

+1
-2
lines changed
  • Sprint-2/1-key-errors

1 file changed

+1
-2
lines changed

Sprint-2/1-key-errors/0.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,5 @@ function capitalise(str) {
2222
// =============> write your new code here
2323
// =============> write your new code here
2424
function capitalise(str) {
25-
let capitalisedStr = `${str[0].toUpperCase()}${str.slice(1)}`;
26-
return capitalisedStr;
25+
return str[0].toUpperCase() + str.slice(1);
2726
}

0 commit comments

Comments
 (0)