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
{{ message }}
Repository navigation
Commit cfa3c0e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: Sprint-3/1-key-errors/0.js
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,13 @@
3
3
4
4
// call the function capitalise with a string input
5
5
// 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
+
functioncapitalise(str){
9
+
letstr=`${str[0].toUpperCase()}${str.slice(1)}`;
10
+
returnstr;
11
+
}
12
+
7
13
8
14
// =============> write your explanation here
9
15
// 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