iota-array

1.0.0 • Public • Published

iota-array

Fills an array with sequential integers. Just like C++'s std::iota() or the similarly named function in APL.

Install

npm install iota-array

Example

 
console.log(require("iota-array")(3))
 
//Prints:
//
//    [0,1,2]
//
 

require("iota-array")(n)

Constructs an array of length n of n sequential integers starting from 0.

  • n the length of the array to construct

Returns: An array of n sequential integers starting at 0

Credits

(c) 2013 Mikola Lysenko. MIT License

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    1,487,045
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    1,487,045
  • 0.0.1
    146
  • 0.0.0
    16

Package Sidebar

Install

npm i iota-array

Weekly Downloads

418,107

Version

1.0.0

License

MIT

Last publish

Collaborators

  • mikolalysenko