Skip to content

Commit b50c220

Browse files
committed
Update to 1-key-errors\0.js, variable name change from Newstr to newStr, to conform with camelCase naming
1 parent 074adf1 commit b50c220

File tree

1 file changed

+2
-2
lines changed
  • Sprint-2/1-key-errors

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// The error is occurring because we are trying to declare a variable 'str' inside the function that has the same name as the parameter 'str'.To fix this problem, create an variable with a new name Newstr . So we would change the line to: Newstr = `${str[0].toUpperCase()}${str.slice(1)}`;
1414
// =============> write your new code here
1515
function capitalise(str) {
16-
let Newstr = `${str[0].toUpperCase()}${str.slice(1)}`;
17-
return Newstr;
16+
let newStr = `${str[0].toUpperCase()}${str.slice(1)}`; //change the variable name to newStr to conform with camelCase name convention.
17+
return newStr;
1818
}
1919
console.log(capitalise("hello world"));

0 commit comments

Comments
 (0)