Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

NW6 | Pedram Amani | Module-JS1 | Week3 #186

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

Conversation

pedram-am
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.

JavaScript 1 - Week 3 exercises

Questions

Ask any questions you have for your reviewer.

Copy link

@bunday bunday left a 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 =
Copy link

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?

@@ -21,3 +21,26 @@
// Identify Reflex Angles:
// When the angle is greater than 180 degrees and less than 360 degrees,
// Then the function should return "Reflex angle"

function getAngleType(angle) {
Copy link

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 ?

@@ -33,3 +33,28 @@
// Explanation: The fraction 3/3 is not a proper fraction because the numerator is equal to the denominator. The function should return false.

// 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) {
Copy link

Choose a reason for hiding this comment

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

very well done.

Copy link
Contributor

@areebsattar areebsattar left a 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));
Copy link
Contributor

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) {
Copy link
Contributor

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
3 participants