Skip to content

Commit 52ca6f0

Browse files
committed
Completed 2-is-proper-fraction.js exercise
1 parent 8175d4d commit 52ca6f0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
function isProperFraction(numerator, denominator) {
1111
if (numerator < denominator) {
1212
return true;
13+
} else {
14+
return false;
1315
}
1416
}
1517

@@ -46,14 +48,14 @@ assertEquals(improperFraction, false);
4648
// target output: true
4749
// Explanation: The fraction -4/7 is a proper fraction because the absolute value of the numerator (4) is less than the denominator (7). The function should return true.
4850
const negativeFraction = isProperFraction(-4, 7);
49-
// ====> complete with your assertion
51+
assertEquals(negativeFraction, true);
5052

5153
// Equal Numerator and Denominator check:
5254
// Input: numerator = 3, denominator = 3
5355
// target output: false
5456
// Explanation: The fraction 3/3 is not a proper fraction because the numerator is equal to the denominator. The function should return false.
5557
const equalFraction = isProperFraction(3, 3);
56-
// ====> complete with your assertion
58+
assertEquals(equalFraction, false);
5759

5860
// Stretch:
5961
// What other scenarios could you test for?

0 commit comments

Comments
 (0)