linear-array
Returns an array filed with linearly increasing numbers, starting from 0 up to the given value - 1 (without offset), or from 1 to the value itself (with offset).
Install
Install with npm:
$ npm install --save linear-array
Usage
Works with safe integers greater than 0.
linearArray(value, [offset])
import linearArray from 'linear-array';
OR;
const linearArray = require('linear-array');
console.log(linearArray(1));
console.log(linearArray(3));
console.log(linearArray(5));
console.log(linearArray(1, true));
console.log(linearArray(3, true));
console.log(linearArray(5, true));
About
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running Tests
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
License
Copyright © 2020, Ivan Spoljaric.
Released under the MIT License.