We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76ad0cc commit 8b8773cCopy full SHA for 8b8773c
Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js
@@ -8,16 +8,13 @@
8
// Then, write the next test! :) Go through this process until all the cases are implemented
9
10
function getAngleType(angle) {
11
- if (
12
- angle === null ||
13
- (typeof angle !== "number" && typeof angle !== "string")
14
- ) {
+ if (typeof angle !== "number" && typeof angle !== "string") {
15
return "Input should be a number or a number in string";
16
}
17
- angle = Number(angle);
18
- if (isNaN(angle)) {
+ if (angle === null || isNaN(Number(angle))) {
19
20
+ angle = Number(angle);
21
if (angle < 0 || angle > 360) {
22
return "Angle should be between 0 and 360";
23
0 commit comments