# arguments-to-array

> Make your function arguments into an actual array

Latest version **1.0.0** (published 2016-02-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install arguments-to-array
pnpm add arguments-to-array
yarn add arguments-to-array
bun add arguments-to-array
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-02-18 |
| First published | 2015-07-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | GochoMugo |
| Maintainers | gochomugo |
| Keywords | function, arguments, array |

## Links

- npm: https://www.npmjs.com/package/arguments-to-array
- Repository: https://github.com/GochoMugo/arguments-to-array
- Homepage: https://github.com/GochoMugo/arguments-to-array#readme
- Issues: https://github.com/GochoMugo/arguments-to-array/issues
- npm.io page: https://npm.io/package/arguments-to-array

## Recent versions

- 1.0.0 (latest) — 2016-02-18
- 0.0.1 — 2015-07-28
- 0.0.0 — 2015-07-28

## README

# arguments-to-array

> Make your function arguments into an actual array

[![node](https://img.shields.io/node/v/arguments-to-array.svg?style=flat-square)](https://www.npmjs.com/package/arguments-to-array) [![npm](https://img.shields.io/npm/v/arguments-to-array.svg?style=flat-square)](https://www.npmjs.com/package/arguments-to-array) [![Travis](https://img.shields.io/travis/GochoMugo/arguments-to-array.svg?style=flat-square)](https://travis-ci.org/GochoMugo/arguments-to-array) [![Gemnasium](https://img.shields.io/gemnasium/GochoMugo/arguments-to-array.svg?style=flat-square)](https://gemnasium.com/GochoMugo/arguments-to-array) [![Coveralls](https://img.shields.io/coveralls/GochoMugo/arguments-to-array.svg?style=flat-square)](https://coveralls.io/github/GochoMugo/arguments-to-array)


## installation:

```bash
⇒ npm install arguments-to-array
```


## arguments:

> The arguments object is an **Array-like** object corresponding to the arguments passed to a function.
>
> The arguments object is **not** an Array. It is similar to an Array, but does **not** have any Array properties except length. For example, it does not have the pop method. However it can be converted to a real Array:
>
> ```js
> var args = Array.prototype.slice.call(arguments);
> ```
>
> From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments

**arguments** is similar to an Array due to the indexing of its values. Like an array is indexed, keys in **arguments** are integers with their order zero-based.


## why this module:

This module (or rather this repo) aims to hold some curated information on **arguments**. It is helpful for JavaScript beginners who wonder why the heck **arguments.forEach()** is not working! Plus it is easier to remember:

```js
var argumentsToArray = require("arguments-to-array");

function example() {
    var array = argumentsToArray(arguments);
}
```

Also, see [this discussion on one-line modules](https://github.com/sindresorhus/ama/issues/10).


## possible alternatives:

### lodash

If you are using **lodash** you need not add this module to your dependencies list. See [lodash docs on _.toArray](https://lodash.com/docs#toArray)

```js
var _ = require("lodash");

function example() {
    var array = _.toArray(arguments);
}
```


## articles on this topic:

* [js common pitfalls](http://nrn.io/view/javascript-common-pitfalls/view/array-like-objects)


## credits:

* [volkovasystems/arguments-to-array](https://github.com/volkovasystems/arguments-to-array) existed before this repo was born!


## license:

*Source code is licensed under the __The MIT License (MIT)__*

Copyright (c) 2015-2016 GochoMugo <mugo@forfuture.co.ke>

---
_Source: https://npm.io/package/arguments-to-array · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
