88// Then, write the next test! :) Go through this process until all the cases are implemented
99
1010function getAngleType ( angle ) {
11- if ( angle === 90 ) return "Right angle" ;
11+ if ( angle === 90 ) return "Right angle" ;
12+ if ( angle < 90 ) return "Acute angle" ;
13+ if ( angle > 90 && angle < 180 ) return "Obtuse angle" ;
14+ if ( angle === 180 ) return "Straight angle" ;
15+ if ( angle > 180 && angle < 360 ) return "Reflex angle" ;
1216 // read to the end, complete line 36, then pass your test here
1317}
1418
@@ -44,13 +48,16 @@ assertEquals(acute, "Acute angle");
4448// Then the function should return "Obtuse angle"
4549const obtuse = getAngleType ( 120 ) ;
4650// ====> write your test here, and then add a line to pass the test in the function above
47-
51+ assertEquals ( obtuse , "Obtuse angle" ) ;
4852// Case 4: Identify Straight Angles:
4953// When the angle is exactly 180 degrees,
5054// Then the function should return "Straight angle"
5155// ====> write your test here, and then add a line to pass the test in the function above
52-
56+ const straight = getAngleType ( 180 ) ;
57+ assertEquals ( straight , "Straight angle" ) ;
5358// Case 5: Identify Reflex Angles:
5459// When the angle is greater than 180 degrees and less than 360 degrees,
5560// Then the function should return "Reflex angle"
56- // ====> write your test here, and then add a line to pass the test in the function above
61+ // ====> write your test here, and then add a line to pass the test in the function above
62+ const reflex = getAngleType ( 270 ) ;
63+ assertEquals ( reflex , "Reflex angle" ) ;
0 commit comments