-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
base: main
Are you sure you want to change the base?
NW6| FIDAA BASHIR | Module-JS1 | WEEK3 #190
Conversation
There was a problem hiding this 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")); |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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!"); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.