We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9cf4441 commit 245e73eCopy full SHA for 245e73e
Sprint-2/1-key-errors/0.js
@@ -9,11 +9,10 @@
9
// interpret the error message and figure out why an error is occurring
10
11
function capitalise(str) {
12
- str = `${str[0].toUpperCase()}${str.slice(1)}`;
+ let str = `${str[0].toUpperCase()}${str.slice(1)}`;
13
return str;
14
}
15
-let result = capitalise("Arun");
16
-console.log(result);
+
17
// =============> write your explanation here
18
// The parameter str is already a local variable inside the function.
19
// Previously, redeclaring it using let caused an error because variables cannot be declared twice in the same scope.
0 commit comments