Skip to content

London | May-2025 | Reza Jahanimir | Coursework/sprint 2 #524

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

Conversation

Reza-Jahanimir
Copy link

Learners, PR Template

Self checklist

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

Changelist

tried to answer the questions and tests

Questions

Ask any questions you have for your reviewer.

@Reza-Jahanimir Reza-Jahanimir added Needs Review Participant to add when requesting review 📅 Sprint 2 Assigned during Sprint 2 of this module labels Jun 12, 2025
Comment on lines 18 to 22

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

Choose a reason for hiding this comment

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

Great solution on this question, but remember that if a variable will not be reassigned after it has been declared, then it should be a const, only use let if you believe that the variable will change later on


// =============> explain this error message here
// First Two Lines: Locate the file path and the specific line of code causing the error.
// Following Lines: Display the type of error (SyntaxError) and its message.

Choose a reason for hiding this comment

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

This is a simple and straight forward explanation, nice job

return result;
}

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

Choose a reason for hiding this comment

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

You provided the right solution here, with a simple suggestion.

The console.log in the function is not necessary, as you will notice that the final result will print out two results, the first is just the result, and the second will be the statement in line 24

const height_squared = height * height;

Choose a reason for hiding this comment

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

Simple solutions that are simple to read are always good code, which you have done here. Just want to draw your attention to some built-in methods that JavaScript has for this same thing

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow

} else if (hours > 12) {
return `${hours - 12} pm`;
} else {
return `${hours} am`;
}

Choose a reason for hiding this comment

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

Your solution is returning 12 pm when we expect to see 12:00 pm, for example.

You need to take a look at the original question again and see how you can do that 🙂

@hokagedemehin hokagedemehin added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jun 22, 2025
@Reza-Jahanimir Reza-Jahanimir added Needs Review Participant to add when requesting review and removed Reviewed Volunteer to add when completing a review labels Jun 22, 2025
}
return `${time} am`;
// If you input "08:00" is allowed to pass
const paddedHour = hourStr.length === 2 && displayHour < 10 ? `0${displayHour}` : `${displayHour}`;

Choose a reason for hiding this comment

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

Nice work in formatting the hour it is returned. I have a resource that you might want to consider should you need to do this again in the future

String Padding

@hokagedemehin hokagedemehin added Complete Volunteer to add when work is complete and review comments have been addressed and removed Needs Review Participant to add when requesting review labels Jun 22, 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 📅 Sprint 2 Assigned during Sprint 2 of this module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants