Skip to content

Commit a56fa7f

Browse files
committed
comments rephrased
1 parent f919f28 commit a56fa7f

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

  • Sprint-3/1-key-errors

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
// Predict and explain first...
2-
// ======> write your prediction here: I predict that the code should cut out, and make the first letter of the string an uppercase letter,
2+
// ======> write your prediction here:
3+
// Answer below:
4+
5+
// I predict that the code should make the first letter of the string an uppercase letter,
36
// then add every letters that comes after
47

58
// call the function capitalise with a string input
69
// interpret the error message and figure out why an error is occurring
710

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

12+
// =============> write your explanation here:
13+
// Answer below:
1314

14-
// =============> write your explanation here: The error read "SyntaxError: Identifier 'str' has already been declared",
15-
// this is as a result of having two variables with same name. The error occoured in this code because the variable "str" has been decleared twice
15+
// The error read "SyntaxError: Identifier 'str' has already been declared",
16+
// This is as a result of having two variables with same name "str".
17+
// The error occoured in this code because the variable "str" has been declared twice
1618

1719
// =============> write your new code here
1820

1921
function capitalise(str) {
2022
return str= `${str[0].toUpperCase()}${str.slice(1)}`;
2123
}
22-
console.log(capitalise("money"))
24+
console.log(capitalise("money"));

0 commit comments

Comments
 (0)