(left: number, right: number)
| 236 | // left: 5, right: 8 |
| 237 | // @return [6, 7]; |
| 238 | export function numbersBetween(left: number, right: number) { |
| 239 | const _left = Math.min(left, right); |
| 240 | const _right = Math.max(left, right); |
| 241 | const diff = _right - _left - 1; |
| 242 | return Array.from({ length: diff }).map((_, index) => _left + index + 1); |
| 243 | } |
| 244 | |
| 245 | // Convert the number to the correct value not NaN; |
| 246 | export function noNaN(n: number) { |
no test coverage detected