Skip to content

London | May-2025 | Khilola_Rustamova | Module Structuring and Testing Data | Sprint 2 #631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Next Next commit
Fix variable redeclaration in capitalise function
  • Loading branch information
HilolaRustam committed Jun 27, 2025
commit a4a9c1d593985126a64d368cb7b0ba018ae12197
12 changes: 12 additions & 0 deletions Sprint-2/1-key-errors/0.js

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the files are missing Predictions, where it's required for you to write your prediction first.

Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,17 @@ function capitalise(str) {
return str;
}

//because str is already existing parameter we can not declare let str again.
// we can rename the str to fix the problem.


function capitalise(str) {
let cap_str = `${str[0].toUpperCase()}${str.slice(1)}`;
return cap_str;
}

console.log(capitalise("khilola"));


// =============> write your explanation here
// =============> write your new code here