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

NW6| FIDAA BASHIR | Module-JS1 | WEEK3 #190

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

Fidaabashir89
Copy link

Learners, PR Template

Self checklist

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

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

Copy link

@pedram-am pedram-am left a comment

Choose a reason for hiding this comment

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

Very well done! I like your codes and the comments you add to clarify them! Have a look at my comments! 👏👍

// a) Write an assertion to check the return value of formatAs12HourClock when it is called with an input "17:42"
// b) Check the assertion output and explain what the bug is
// c) Now fix the bug and re-run all your assertions
console.log(formatAs12HourClock("11:00"));

Choose a reason for hiding this comment

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

Well done! We can also try different cases using console.log to make sure that the code works properly for any kind of input.

console.log(getAngleType(120));
console.log(getAngleType(180));
console.log(getAngleType(200));
console.log(getAngleType(540));

Choose a reason for hiding this comment

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

Perfect! 👍 That's great you considered the invalid inputs as well, to return invalid angles!

throw new Error("Invalid card rank.");
}
}
console.log(getCardValue(10));

Choose a reason for hiding this comment

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

Great attempt to implement the function! Try to run your code again and find out how to fix the error if it gives you any error! We also need to write assertions using console.assert as the exercise asks us to do, in line 5!

console.assert(isProperFraction(-4, 7) === true, "Test Case 4 Failed"); // Negative Fraction check
console.assert(isProperFraction(3, 3) === false, "Test Case 5 Failed"); // Equal Numerator and Denominator check

console.log("All assertions passed!");

Choose a reason for hiding this comment

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

That's correct! All the assertions you wrote, passed! Great job! 👍

@@ -38,3 +38,12 @@
// Then it should return true because the input forms a valid triangle.

// This specification outlines the behavior of the isValidTriangle function for different input scenarios, ensuring it properly checks for invalid side lengths and whether they form a valid triangle according to the Triangle Inequality Theorem.

function isValidTriangle(a, b, c) {

Choose a reason for hiding this comment

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

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants