iota-array

Generates an array of consecutive integers starting at 0

MIT 3 个版本
安装
npm install iota-array
yarn add iota-array
pnpm add iota-array
bun add iota-array
README

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

版本列表
1.0.0 2014-04-28
0.0.1 2013-06-26
0.0.0 2013-04-04