Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Weekly downloads
206K
increased by17.57%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc