super-range
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

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

Package Sidebar

Install

npm i super-range

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

5.99 kB

Total Files

8

Last publish

Collaborators

  • kkyo