Skip to content

Commit cfa3c0e

Browse files
committed
resolve error 0
1 parent 0921c64 commit cfa3c0e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • Sprint-3/1-key-errors

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33

44
// call the function capitalise with a string input
55
// interpret the error message and figure out why an error is occurring
6-
// The str identifier has already been declared in the function parameter and cannot be declared anywhere else inside the function as a variable
6+
// The str identifier has already been declared in the function parameter and cannot be declared anywhere else inside the function as a variable
7+
8+
function capitalise(str) {
9+
let str = `${str[0].toUpperCase()}${str.slice(1)}`;
10+
return str;
11+
}
12+
713

814
// =============> write your explanation here
915
// When a parameter is declared in a function, it causes an Error if it is declared inside the function as a variable, either you change the name used for the instructions or remove let

0 commit comments

Comments
 (0)