Uh oh!
There was an error while loading. Please reload this page.
NW6 | Pedram Amani | Module-JS1 | Week3 - #186
Conversation
| const minutes = Number(time.slice(3)); | ||
| if (hours >= 12) { | ||
| const formattedHoursAfternoon = |
There was a problem hiding this comment.
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.
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) { |
| 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.
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.
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.