🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

super-range

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

super-range

A simple range function

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
6
100%
Maintainers
1
Weekly downloads
 
Created
Source

super-range

super-range is an easy way to generate a number. Inspired by range function in Python, I created the super-range

Install

Using npm:

npm install super-range

or Using Yarn:

yarn add super-range

Usage

Using One Parameter

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

Using Two Parameter

const result = [...range(5, 10)]; //[5,6,7,8,9]

Using Three Parameter

const result1 = [...range(1, 10, 3)];  // [1,4,7];
const result2 = [...range(10, 3, -3)]; // [10,7,4]

Using With for statement

 for (const element of range(5)) {
        console.log(element)
    }

Keywords

typescript

FAQs

Package last updated on 31 Jul 2023

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