File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11// Predict and explain first...
2- // =============> write your prediction here
2+ // we can not declare a variable which has the same name as the parameter, we will get a SyntaxError
33
44// call the function capitalise with a string input
55// interpret the error message and figure out why an error is occurring
@@ -8,6 +8,7 @@ function capitalise(str) {
88 let str = `${ str [ 0 ] . toUpperCase ( ) } ${ str . slice ( 1 ) } ` ;
99 return str ;
1010}
11+ console . log ( capitalise ( "hello" ) )
1112
12- // =============> write your explanation here
13- // =============> write your new code here
13+ // we are getting an error because of the way the function was wrote, "str" is the part that is causing the issue
14+ // we can not declare a variable which has the same name as the parameter
You can’t perform that action at this time.
0 commit comments