2.0.0 • Published 7 years ago

@f/range v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

range

Build status Git tag NPM version Code style

Generate a range of numbers with a given (optional) step size

Installation

$ npm install @f/range

Usage

var range = require('@f/range')


range(4)        // -> [0, 1, 2, 3]
range(1, 4)     // -> [1, 2, 3]
range(4, 1, -1) // -> [4, 3, 2]

API

range(start, end, step)

  • start - Start of the sequence. If you pass only one argument, this is taken as the end, and the implied start is 0.
  • end - End of the sequence.
  • step - Step size. Optional, defaults to 1.

Returns: An array of the range of values between start and end, in increments of step size.

License

MIT