Skip to content

player31-kks/super-range

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
}

License

The source code for the site is licensed under the MIT license, which you can find in the MIT-LICENSE.txt file.

About

A simple range function

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors