-
-
Notifications
You must be signed in to change notification settings - Fork 50
NW6 | Pedram Amani | Module-JS1 | Week3 #186
base: main
Are you sure you want to change the base?
Conversation
bunday
left a comment
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.
a well done job here, keep it up
| const minutes = Number(time.slice(3)); | ||
|
|
||
| if (hours >= 12) { | ||
| const formattedHoursAfternoon = |
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.
there is a concept called Do not Repeat Yourself (DRY) it is a concept where you write a code once and you reuse it, instead of rewritten the same code again, you can read more about. formattedHoursAfternoon and formattedHoursMorning have a couple of common code, can you think of a way to extract that into a reusable function?
| // When the angle is greater than 180 degrees and less than 360 degrees, | ||
| // Then the function should return "Reflex angle" | ||
|
|
||
| function getAngleType(angle) { |
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.
what happens when the angle passed is less than 0 ?
|
|
||
| // These acceptance criteria cover a range of scenarios to ensure that the isProperFraction function handles both proper and improper fractions correctly and handles potential errors such as a zero denominator. | ||
|
|
||
| function isProperFraction(numerator, denominator) { |
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.
areebsattar
left a comment
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.
JS1 ticket review
| console.log(isValidTriangle(3, 4, 5)); | ||
| console.log(isValidTriangle(1, 1, 3)); | ||
| console.log(isValidTriangle(-2, 2, 5)); | ||
| console.log(isValidTriangle(7, "apple", 5)); |
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.
Good implementation with multiple examples
| return "Obtuse angle"; | ||
| } else if (angle === 180) { | ||
| return "Straight angle"; | ||
| } else if (angle > 180 && angle < 360) { |
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.
I have learned that we can use if statements again and again rather that else if, I have had quite a lot of issues using else if in few code blocks
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
JavaScript 1 - Week 3 exercises
Questions
Ask any questions you have for your reviewer.