including-range-array

1.0.0 • Public • Published

including-range-array

including-range-array is a simple module, which adds two new methods, namely range() and random().

Usage

You start using this module by requiring it (as every other npm module), like so:

const { range, random } = require("including-range-array")

The range(max, min = 0) method

To use the range() method, you use it in this way:

range(10) // => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
 
// You can also specify a 'min' number
range(10, 4) // => [4, 5, 6, 7, 8, 9, 10]

The random(max, min = 0) method

The random() method returns a random number between the specified range. To use it, instead, you do like this:

random(10) // => 6
 
// You can also specify a 'min' number
random(10, 4) // => 8

/including-range-array/

    Package Sidebar

    Install

    npm i including-range-array

    Weekly Downloads

    7

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    2.33 kB

    Total Files

    5

    Last publish

    Collaborators

    • samplasion