Skip to content

Commit a09f7df

Browse files
committed
wrote the fixed code and made the code with the bag comment
1 parent ff58b19 commit a09f7df

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

  • Sprint-3/1-key-errors

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
//It says syntax error Identifier 'str' has already been declared.
77
// function parameter and let which is inside the funtion can never
88
// be the same because both variables are in the same scope
9-
function capitalise(str) {
10-
let str = `${str[0].toUpperCase()}${str.slice(1)}`;
11-
return str;
12-
}
13-
console.log(capitalise("error")
9+
// function capitalise(str) {
10+
//let str = `${str[0].toUpperCase()}${str.slice(1)}`;
11+
//return str;
12+
//}
13+
//console.log(capitalise("error")
1414
//
15-
// function capitalise(firstLetter){
16-
// let str =`${str[0].toUpperCase()${str.slice(1)}`;
17-
// return str;
18-
// }
19-
//
15+
function capitalise(firstLetter){
16+
let str =`${firstLetter[0].toUpperCase()}${firstLetter.slice(1)}`
17+
return str;
18+
}
19+
console.log(capitalise("error"));
2020

0 commit comments

Comments
 (0)