Skip to content
Generates arrays of sequential integers
JavaScript
Find file
Latest commit 355beb8 @mikolalysenko mikolalysenko 1.0.0
Failed to load latest commit information.
test 1.0.0
.gitignore adding files
.npmignore added .npmignore
LICENSE adding LICENSE
README.md adding files
iota.js adding files
package.json 1.0.0

README.md

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

Something went wrong with that request. Please try again.