(left, right, inclusive)
| 1456 | |
| 1457 | |
| 1458 | function __range__(left, right, inclusive) { |
| 1459 | let range = []; |
| 1460 | let ascending = left < right; |
| 1461 | let end = !inclusive ? right : ascending ? right + 1 : right - 1; |
| 1462 | for (let i = left; ascending ? i < end : i > end; ascending ? i++ : i--) { |
| 1463 | range.push(i); |
| 1464 | } |
| 1465 | return range; |
| 1466 | } |