Lodash's inRange(number, startNumber, endNumber);
Can't understand why it swaps startNumber
with endNumber
, if startNumber
is greater than endNumber
?
I read the documentation but still don't understand why.
It's syntactic sugaring. The functionality is to check whether a number is between two other numbers (start
and end
), regardless of which one of them is greater than the other.