Skip to content

Commit 68d1266

Browse files
committed
Refactor isProperFraction function for improved readability
1 parent 8a9d777 commit 68d1266

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

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

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

1313
function isProperFraction(numerator, denominator) {
14-
if (denominator === 0) {
15-
return false;
16-
}
17-
return Math.abs(numerator) < Math.abs(denominator);
14+
return denominator !== 0 && Math.abs(numerator) < Math.abs(denominator);
1815
}
1916

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

0 commit comments

Comments
 (0)