Skip to content

Commit 6cb72d1

Browse files
authored
Simplify isProperFraction implementation
1 parent e59ab40 commit 6cb72d1

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@
1111
// execute the code to ensure all tests pass.
1212

1313
function isProperFraction(numerator, denominator) {
14-
// [ChunYanWong] Implement this function
15-
if (denominator === 0) {
16-
return false;
17-
}
18-
19-
// Compare absolute values
20-
return Math.abs(numerator) < Math.abs(denominator);
14+
return denominator !== 0 && Math.abs(numerator) < Math.abs(denominator);
2115
}
2216

2317
// The line below allows us to load the isProperFraction function into tests in other files.

0 commit comments

Comments
 (0)