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 47a9c16
Browse filesBrowse the repository at this point in the historyBrowse files
// =============> write your prediction here==> SyntaxError because str is declared twice (parameter + let)
4
3
// call the function capitalise with a string input
5
4
// interpret the error message and figure out why an error is occurring
6
-
5
+
//function capitalise(str) {
6
+
// let str = `${str[0].toUpperCase()}${str.slice(1)}`;
7
+
// return str;
8
+
//}
9
+
// =============> write your explanation here==> (let str) will make a syntaxerror because str is already declared as parameter in the function: [function capitalise(str) ] and we can not declare an identifier in the same scope
0 commit comments