Skip to content

Commit 915e030

Browse files
authored
Refactoring
1 parent 89d73a8 commit 915e030

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

isNumberInRange.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @returns {Boolean}
88
*/
99
function inRange(x, min, max) {
10-
return ((x-min)*(x-max) <= 0);
10+
return x >= min && x <= max;
1111
}
1212

1313
//test

0 commit comments

Comments
 (0)