File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 11// Predict and explain first...
2- // =============> write your prediction here
2+ // I think this function capitalise is meant to make the first letter of a string into uppercase then return the string
33
44// call the function capitalise with a string input
55// interpret the error message and figure out why an error is occurring
@@ -9,5 +9,11 @@ function capitalise(str) {
99 return str ;
1010}
1111
12- // =============> write your explanation here
13- // =============> write your new code here
12+ // I got the error "SyntaxError: Identifier 'str' has already been declared"
13+ // to fix this, I just removed the word let in line 8. This gave a value to str without trying to declare it again
14+ // I ran the new code and there were no errors
15+
16+ // function capitalise(str) {
17+ // str = `${str[0].toUpperCase()}${str.slice(1)}`;
18+ // return str;
19+ // }
You can’t perform that action at this time.
0 commit comments