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 believe the code is trying to write the first letter of a string on capital letter. But since the "str" declaration has already been used, we will need a new name
3
4
4
5
// call the function capitalise with a string input
5
6
// interpret the error message and figure out why an error is occurring
6
7
7
-
functioncapitalise(str){
8
-
letstr=`${str[0].toUpperCase()}${str.slice(1)}`;
9
-
returnstr;
10
-
}
8
+
// function capitalise(str) {
9
+
// let str = `${str[0].toUpperCase()}${str.slice(1)}`;
10
+
// return str;
11
+
// }
11
12
12
-
// =============> write your explanation here
13
+
// =============> write your explanation here: //There is a SynthaxError on line 9 of the code when we try to declare a new variable with the name "str". This is because the "str" name has already been used when declaring the function "capitalise".
0 commit comments