1.0.2 • Published 4 years ago

@ivanhanak_com/array-range-es6 v1.0.2

Weekly downloads
-
License
https://www.imdb....
Repository
github
Last release
4 years ago

array-range-es6

npm.io NPM Weekly Downloads

Absolutely lightweight (0.01kb) library to create an array range.

It's basically this line of code: export default (length) => ([...Array(length).keys()] ); but is like a library so you don't have to define it million times in your project.

You can find array-range for older browsers (e.g. IE11) here.

Changelog

See the whole Changelog.

Install

Using npm:

npm install @ivanhanak_com/array-range-es6

Using yarn:

yarn add @ivanhanak_com/array-range-es6

Import

import range from '@ivanhanak_com/array-range-es6';

Usage

const rangeItems = range(5); //creates [0,1,2,3,4]

Browser support

EDGE 13+, Safari 12+, (✅ and also Chrome & Firefox)