Skip to content

Commit 9fede25

Browse files
committed
explained the function
1 parent b31a586 commit 9fede25

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • Sprint-2/1-key-errors

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Predict and explain first...
22
// =============> write your prediction here
3+
//the function is there for capitalise the given string
34

45
// call the function capitalise with a string input
56
// interpret the error message and figure out why an error is occurring
@@ -9,5 +10,11 @@ function capitalise(str) {
910
return str;
1011
}
1112

13+
console.log(capitalise("hello"))
1214
// =============> write your explanation here
15+
// Identifier 'str' has already been declared - means the variable already exist - with the let you don't need to declare this again
1316
// =============> write your new code here
17+
//function capitalise(str) {
18+
// str = `${str[0].toUpperCase()}${str.slice(1)}`;
19+
//return str;
20+
//}

0 commit comments

Comments
 (0)