JSPM

  • Created
  • Published
  • Downloads 135
  • Score
    100M100P100Q77000F
  • License MIT

Arguments to array, the easy way

Package Exports

  • args-to-arr

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

Readme

args-to-arr

CircleCI Greenkeeper badge npm codecov GitHub

Arguments to array, the easy way

Install

npm install args-to-arr

Usage

Syntax

toArray<T>(arr: ArrayLike<T>, start: number = 0): T[];

Note that args-to-arr supports any array-like object

Example

import toArray from "args-to-arr";


function anything(firstArg) {

  // convert arguments to array
  // starting from argument 1
  const args = toArray(arguments, 1);

  // do something with the array

}

License

MIT License