1212
1313function isProperFraction ( numerator , denominator ) {
1414 // TODO: Implement this function
15- if ( denominator === 0 ) {
15+ if ( denominator === 0 ) {
1616 return false ;
1717 }
1818 let fraction = numerator / denominator ;
@@ -34,26 +34,26 @@ function assertEquals(actualOutput, targetOutput) {
3434// TODO: Write tests to cover all cases.
3535// What combinations of numerators and denominators should you test?
3636
37- // Example: 1/2 is a proper fraction
37+ // Example: 1/2 is a proper fraction.
3838assertEquals ( isProperFraction ( 1 , 2 ) , true ) ;
3939
40- // Example: numerator is 0 is a proper fraction
40+ // Example: numerator is 0, not a proper fraction.
4141assertEquals ( isProperFraction ( 0 , 2 ) , false ) ;
4242
43- // Example: numerator is equal to denominators is a proper fraction
43+ // Example: numerator is equal to denominators, not a proper fraction.
4444assertEquals ( isProperFraction ( 2 , 2 ) , false ) ;
4545
46- // Example: denominator is 0 is a proper fraction
46+ // Example: denominator is 0,not a proper fraction.
4747assertEquals ( isProperFraction ( 5 , 0 ) , false ) ;
4848
49- // Example: numerator is negative is a proper fraction
49+ // Example: numerator is negative, not a proper fraction.
5050assertEquals ( isProperFraction ( - 1 , 2 ) , false ) ;
5151
52- // Example: denominator is negative is a proper fraction
52+ // Example: denominator is negative,not a proper fraction.
5353assertEquals ( isProperFraction ( 4 , - 3 ) , false ) ;
5454
55- // Example: numerator and denominator are both negative values is a proper fraction
55+ // Example: numerator and denominator are both negative values is a proper fraction.
5656assertEquals ( isProperFraction ( - 5 , - 6 ) , true ) ;
5757
58- // Example: negative numerator with smaller value then negative dominator is a proper fraction
58+ // Example: negative numerator with smaller value then negative dominator, not a proper fraction.
5959assertEquals ( isProperFraction ( - 6 , - 5 ) , false ) ;
0 commit comments