There was an error while loading. Please reload this page.
1 parent e59ab40 commit 6cb72d1Copy full SHA for 6cb72d1
1 file changed
Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js
@@ -11,13 +11,7 @@
11
// execute the code to ensure all tests pass.
12
13
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);
+ return denominator !== 0 && Math.abs(numerator) < Math.abs(denominator);
21
}
22
23
// The line below allows us to load the isProperFraction function into tests in other files.
0 commit comments