iota-array
Generates an array of consecutive integers starting at 0
Last updated 11 years ago by mikolalysenko .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install iota-array 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.0                                ...           latest (11 years ago)

3 Versions

  • 1.0.0                                ...           11 years ago
  • 0.0.1                                ...           11 years ago
  • 0.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |