Skip to content

Commit 49088fa

Browse files
committed
Answered 0.js and added new code
1 parent d28242a commit 49088fa

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

  • Sprint-3/1-key-errors

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

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

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

1212
// =============> write your explanation here
13+
// The str has already been called so when its been set to the "let = str" it wont work as its already part of the function, so the name needs to change.
1314
// =============> write your new code here
15+
function capitalise(str) {
16+
let capitaliseStr = `${str[0].toUpperCase()}${str.slice(1)}`;
17+
return str;
18+
}

0 commit comments

Comments
 (0)