/range/empty
stdChecks if the given range is empty.
Type signature
([min, max]: [number, number]) => boolean
Questions
- How to check if a given range is empty (0-length)?
([min, max]: [number, number]) => boolean
([a, b]: [number, number], [c, d]: [number, number]) => boolean
equals([1, 2], [1, 2]);
// ⇒ true
Try in REPL
equals([4, 3], [1, 2]);
// ⇒ false
Try in REPL
([min, max]: [number, number]) => number
(used: [number, number][], sourceRange?: number[]) => (range: [number, number]) => [number, number][];
export default split
split([
[2, 3],
[5, 7],
]);
// ⇒ [[0, 2], [3, 5], [7, 10]]
Try in REPL