Skip to content

Commit f76aa55

Browse files
committed
Add explanation for SyntaxError in capitalise function
1 parent 0dcdd7f commit f76aa55

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • Sprint-3/1-key-errors

‎Sprint-3/1-key-errors/0.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ function capitalise(str) {
1313
}
1414
capitalise("moses");
1515
// =============> write your explanation here
16+
// The error here is because the parameter 'str' and the variable 'let str' share the same name in he same scope, thus the SyntaxError.
17+
// To fix this error, I could either give the variable a different name or reassign the parameter 'str' without 'let', since no new declaration is made
18+
1619
// =============> write your new code here

0 commit comments

Comments
 (0)