Skip to content

Commit 5343b19

Browse files
author
lintsang
committed
Make sure only Sprint 1 files is touched
1 parent f20321b commit 5343b19

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Predict and explain first...
2-
// =============> I predict this code will create a function which can capitalise the first letter of a string and keep the second letters to last one the same. This string is stored and return to the function call.
2+
// =============> write your prediction here
33

44
// call the function capitalise with a string input
55
// interpret the error message and figure out why an error is occurring
@@ -9,8 +9,5 @@ function capitalise(str) {
99
return str;
1010
}
1111

12-
// =============> The error message shows "SyntaxError: Identifier 'str' has already been declared". And it indicated the variable name 'str' at line 8, I think it triggered a syntax error when try to declare 'str' in the function while it is already being defined as a function parameter. So I changed it to 'strStored' in the function and it works.
13-
// =============> function capitalise(str) {
14-
// let strStored = `${str[0].toUpperCase()}${str.slice(1)}`;
15-
// return strStored;
16-
//}
12+
// =============> write your explanation here
13+
// =============> write your new code here

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ console.log(decimalNumber);
1717
// =============> write your explanation here
1818

1919
// Finally, correct the code to fix the problem
20-
// =============> write your new code here
20+
// =============> write your new code here

0 commit comments

Comments
 (0)