PortablePosPrinterHamekara/node_modules/iota-array
mehranz c2686e7110 initial commit 2025-11-15 13:33:50 +03:30
..
.npmignore initial commit 2025-11-15 13:33:50 +03:30
LICENSE initial commit 2025-11-15 13:33:50 +03:30
README.md initial commit 2025-11-15 13:33:50 +03:30
iota.js initial commit 2025-11-15 13:33:50 +03:30
package.json initial commit 2025-11-15 13:33:50 +03:30

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