Skip to content

Commit a318e04

Browse files
called a function , interpreted the error message
1 parent 8f3d6cf commit a318e04

File tree

1 file changed

+4
-3
lines changed
  • Sprint-2/1-key-errors

1 file changed

+4
-3
lines changed

Sprint-2/1-key-errors/0.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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

0 commit comments

Comments
 (0)