1.0.0 • Published 9 years ago

js-range v1.0.0

Weekly downloads
138
License
MIT
Repository
github
Last release
9 years ago

npm Build Status

js-range

A function to generate an array sequence of numbers from start (inclusive) to end (exclusive), by step, where start and end defaults to 0, and step to 1. When start is equal to end, returns empty list. Similar to Clojure's range, but without laziness.

Installation

npm i -S js-range

Usage

import range from 'js-range';

range(5, 8); // [5, 6, 7]
range(5, 10, 2); // [5, 7, 9]
range(10, 5); // [10, 9, 8, 7, 6]
range(3, -10, -3) // [3, 0, -3, -6, -9]