Skip to content

Commit a818573

Browse files
committed
Refactor capitalise function to remove unnecessary variable assignment
1 parent 42c8e32 commit a818573

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

  • Sprint-3/1-key-errors

‎Sprint-3/1-key-errors/0.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
// console.log(capitalise("moses"));
2525
// |
2626
function capitalise(str) {
27-
str = `${str[0].toUpperCase()}${str.slice(1)}`;
28-
return str;
27+
return `${str[0].toUpperCase()}${str.slice(1)}`;
2928
}
3029
console.log(capitalise("moses"));

0 commit comments

Comments
 (0)