util.js 226 B

123456789101112131415
  1. 'use strict'
  2. function range(from, to) {
  3. // TODO: make this inlined.
  4. const list = new Array(to - from + 1)
  5. for(let i = 0; i < list.length; ++i) {
  6. list[i] = from + i
  7. }
  8. return list
  9. }
  10. module.exports = {
  11. range
  12. }