You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// I thought it was going to work, however my prediction was wrong. =============> write your prediction here
3
3
4
4
// call the function capitalise with a string input
5
+
6
+
//SyntaxError: Identifier 'str' has already been declared
7
+
8
+
5
9
// interpret the error message and figure out why an error is occurring
6
10
7
11
functioncapitalise(str){
8
12
letstr=`${str[0].toUpperCase()}${str.slice(1)}`;
9
13
returnstr;
10
14
}
11
15
12
-
// =============> write your explanation here
13
-
// =============> write your new code here
16
+
17
+
18
+
19
+
// The identifier "str" has already been declared as a parameter in the function and cannot be redeclared withing a block scope.// =============> write your explanation here
0 commit comments