Skip to content

London| Emmanuel Gessessew | Module-Structuring-and-Testing-Data/ sprint 2 | WEEK 2 #130

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 9 commits into
base: main
Choose a base branch
from

Conversation

Emmanuelgessessew
Copy link

Learners, PR Template

Self checklist

  • [ yes] I have committed my files one by one, on purpose, and for a reason
  • [yes ] I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • [yes ] I have tested my changes
  • [yes ] My changes follow the style guide
  • [yes ] My changes meet the requirements of this task

Changelist

Briefly explain your PR.
i made changes and corrected some errors and also interpreted some codes.

Questions

Ask any questions you have for your reviewer.

@Emmanuelgessessew Emmanuelgessessew added the 👀 Review Git Changes requested to do with Git label Nov 12, 2024
@Emmanuelgessessew Emmanuelgessessew added Needs Review Participant to add when requesting review and removed 👀 Review Git Changes requested to do with Git labels Nov 22, 2024
Copy link
Member

@SallyMcGrath SallyMcGrath left a comment

Choose a reason for hiding this comment

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

Thanks for your hard work here, @Emmanuelgessessew . Really great stuff.

Your PR is still really messed up. You need to open from MAIN for each new branch. Come to class to get help with understanding this.

In real life this work would be rejected. But in this case, spend a bit of time instead on thinking about my questions and comments. Take a look in the solutions branch and compare your work and think about revising one or two things. This is a a really strong learning technique.

Good luck!

// console.log(a * b);
// }

// console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
Copy link
Member

Choose a reason for hiding this comment

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

It would be very beneficial for your learning to formally write out your prediction before changing the code.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! I'll make sure to write out my predictions before making any changes in the future to better understand the code and improve my learning process.

// Explain why getLastDigit is not working properly - correct the problem

// correction
// when the num is defined in the above code it uses the const it should use the let, since getLastDigit is not a constant number.
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I don't think let or const is salient here.

Do you think you need to assign 103 to num? Why would you need to do this?

Copy link
Author

Choose a reason for hiding this comment

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

how about this, function getLastDigit(num) {
return num % 10;
}


//correction
// the problem is the capitalise function is that it is re declaring the str parameter inside the function using let.
// we canot do that cause the str is already a defined function.
Copy link
Member

Choose a reason for hiding this comment

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

It's not a defined function. It is defined, but what is it, exactly? Try to be precise here in your explanation.

Copy link
Author

Choose a reason for hiding this comment

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

function capitalize(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
}, wat if i do this

function capitalise(str) {
let str = `${str[0].toUpperCase()}${str.slice(1)}`;
str = `${str[0].toUpperCase()}${str.slice(1)}`;
Copy link
Member

Choose a reason for hiding this comment

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

Do you need to assign this to str? Have a think

Copy link
Author

Choose a reason for hiding this comment

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

i don't need to assign the capitalized string back to str. Instead, function capitalise(str) {
return ${str[0].toUpperCase()}${str.slice(1)};
}


//correction
// the problem in the above code is that it redeclaring the decimalNumber with const.
// and the The variable decimalNumber is only available inside the function calling it outside will result in error
Copy link
Member

Choose a reason for hiding this comment

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

What kind of error?

Copy link
Author

Choose a reason for hiding this comment

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

The error will be when u encounter if you try to access decimalNumber outside the function is a ReferenceError

// }

// correction
// the problem in the above code is it didnt defined the num as a parameter of square.
Copy link
Member

Choose a reason for hiding this comment

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

Can 3 ever be a parameter in JavaScript? What kind of error did this code produce?

@@ -22,3 +22,5 @@ console.assert(
currentOutput2 === targetOutput2,
Copy link
Member

Choose a reason for hiding this comment

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

What happened here? Do you need help with this one?


function toUpperSnakeCase(input) {

const withUnderscores = input.replace(/ /g, "_");
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

@SallyMcGrath SallyMcGrath added 👀 Review Git Changes requested to do with Git Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review labels Nov 29, 2024
@Emmanuelgessessew Emmanuelgessessew added the Complete Volunteer to add when work is complete and review comments have been addressed label Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Volunteer to add when work is complete and review comments have been addressed 👀 Review Git Changes requested to do with Git Reviewed Volunteer to add when completing a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants