Skip to main content

typedefs/Range.js

  1. /**
  2. * Describe a range of integers. Must contain either a "to" or "length" property.
  3. * @typedef {Object} Range
  4. * @property {number} [from=0] - the lower bound of the range (inclusive)
  5. * @property {?number} to - the upper bound of the range (inclusive). Must be >= to the "from" value
  6. * @property {?number} length - the length of the range. Must be >= 0
  7. * @example
  8. // The following range specifies the numbers 0, 1, and 2
  9. {from: 0, to: 2}
  10. // The following range specifies the numbers 1 and 2
  11. {from: 1, length: 2}
  12. */