Skip to content
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

CYF London | Anna Fedyna | Module-Structuring-and-Testing-Data | Week2 #69

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
errors done sp2
  • Loading branch information
annafedyna committed Nov 11, 2024
commit faa1c383f560bbe6825cea8ec30c6c1d57209170
2 changes: 1 addition & 1 deletion Sprint-2/errors/0.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
// interpret the error message and figure out why an error is occurring

function capitalise(str) {
let str = `${str[0].toUpperCase()}${str.slice(1)}`;
str = `${str[0].toUpperCase()}${str.slice(1)}`;
return str;
}
3 changes: 1 addition & 2 deletions Sprint-2/errors/1.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
// Try playing computer with the example to work out what is going on

function convertToPercentage(decimalNumber) {
const decimalNumber = 0.5;
const percentage = `${decimalNumber * 100}%`;

return percentage;
}

console.log(decimalNumber);
console.log(convertToPercentage(0.5));
2 changes: 1 addition & 1 deletion Sprint-2/errors/2.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// this function should square any number but instead we're going to get an error

function square(3) {
function square(num) {
return num * num;
}

Expand Down