You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

array-range

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-range

creates a new array with given range

1.0.1
latest
Source
npm
Version published
Weekly downloads
270K
4.96%
Maintainers
1
Weekly downloads
 
Created

What is array-range?

The array-range npm package is a simple utility for generating arrays of numbers within a specified range. It is useful for creating sequences of numbers for various purposes, such as iteration, pagination, or testing.

What are array-range's main functionalities?

Generate a range of numbers

This feature allows you to generate an array of numbers starting from a specified value up to, but not including, another specified value.

const range = require('array-range');
const numbers = range(1, 5); // [1, 2, 3, 4]

Generate a range with a step

This feature allows you to generate an array of numbers with a specified step value, providing more control over the sequence.

const range = require('array-range');
const numbers = range(0, 10, 2); // [0, 2, 4, 6, 8]

Generate a descending range

This feature allows you to generate a descending array of numbers by specifying a start value greater than the end value.

const range = require('array-range');
const numbers = range(5, 1); // [5, 4, 3, 2]

Other packages similar to array-range

Keywords

filled

FAQs

Package last updated on 09 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts