Skip to content

Commit f5a273a

Browse files
committed
I fixed errors and its able to run the code
1 parent 3ae35f7 commit f5a273a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
// call the function capitalise with a string input
66
// interpret the error message and figure out why an error is occurring
77

8-
function capitalise(str) {
9-
let str = `${str[0].toUpperCase()}${str.slice(1)}`;
10-
return str;
11-
}
8+
// function capitalise(str) {
9+
// let str = `${str[0].toUpperCase()}${str.slice(1)}`;
10+
// return str;
11+
// }
1212

1313
// =============> write your explanation here
1414
// The error happened because 'str' was declared twice, once as a parameter and once with 'let' inside the function.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// =============> write your explanation here
1414

1515
// I tried to run the code it gives me SyntaxError,that the decimalNumber has already been declared, we can see in the parameter already has name decimalNumber.
16-
// thats why declaring it again inside the function, causes an error.
16+
// thats why declaring it again inside the function, causes an errors.
1717

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
// =============> explain this error message here
1313
// the parameter can't be a number like (3),also changing num * num to number instead to match the parameter.
14-
// Finally, correct the code to fix the problem
14+
// Finally, correct the code to fix the problem.
1515

1616
// =============> write your new code here
1717
function square(number) {

0 commit comments

Comments
 (0)