JSPM

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

Create an array with sequential numbers

Package Exports

  • ml-array-sequential-fill
  • ml-array-sequential-fill/lib-es6/index.js
  • ml-array-sequential-fill/lib/index.js

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 (ml-array-sequential-fill) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ml-array-sequential-fill

NPM version npm download

Fill an array with sequential numbers or create a new array containing sequential numbers.

Installation

$ npm install --save ml-array-sequential-fill

Usage

import sequentialFill from 'ml-array-sequential-fill';

var array = sequentialFill({from:0, to:10, size: 6});

// array = [0,2,4,6,8,10]

// The following alternatives gives the same result
var array = sequentialFill(undefined, {from:0, to:10, size: 6});
var array = sequentialFill([], {from:0, to:10, size: 6});
var array = sequentialFill([1,2,3], {from:0, to:10, size: 6});
var array = sequentialFill({from:0, to:10, step: 2});

If you provide an array the array will be modified ! If you would like a new array you may provide as value 'undefined' or just skip this value.

License

MIT