JSPM

iota-array

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 614690
  • Score
    100M100P100Q189699F
  • License MIT

Generates an array of consecutive integers starting at 0

Package Exports

  • iota-array

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (iota-array) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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