https://github.com/doasync/create-range
Creates an array of integers
https://github.com/doasync/create-range
Last synced: 12 months ago
JSON representation
Creates an array of integers
- Host: GitHub
- URL: https://github.com/doasync/create-range
- Owner: doasync
- License: mit
- Created: 2017-08-04T19:28:49.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-08T10:12:46.000Z (over 8 years ago)
- Last Synced: 2025-03-11T14:37:25.618Z (12 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Create range
===================
Creates an array of integers from start up to end. Always returns an array. Never throws any errors.
----------
Installation
-------------
```bash
npm i --save create-range
```
Usage
-------------------
Create an array of integers:
```javascript
const fromTenToTwenty = createRange(10, 20);
// [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
const minusPlusFifty = createRange(-50, 50);
// [-50, -49, ... , 49, 50]
const x = createRange(-Infinity, undefined);
// []
```