Skip to content

Commit 02fcc1a

Browse files
committed
Refactor code with Math.abs.
1 parent 8915aa0 commit 02fcc1a

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎implement-and-rewrite-tests/implement/2-is-proper-fraction.js‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515

1616
export function isProperFraction(numerator, denominator) {
1717
// TODO: Implement this function
18-
19-
if ((numerator < 0) || (denominator < 0))
20-
return false;
21-
if (numerator < denominator) {
18+
if (Math.abs(numerator) < Math.abs(denominator)) {
2219
return true;
2320
} else {
2421
return false;

0 commit comments

Comments
 (0)