
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600Ă Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600Ă faster than humans.
arguments-to-array
Advanced tools
Make your function arguments into an actual array
â npm install arguments-to-array
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:
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.
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:
var argumentsToArray = require("arguments-to-array");
function example() {
var array = argumentsToArray(arguments);
}
Also, see this discussion on one-line modules.
If you are using lodash you need not add this module to your dependencies list. See lodash docs on _.toArray
var _ = require("lodash");
function example() {
var array = _.toArray(arguments);
}
Source code is licensed under the The MIT License (MIT)
Copyright (c) 2015-2016 GochoMugo mugo@forfuture.co.ke
FAQs
Make your function arguments into an actual array
We found that arguments-to-array demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600Ă faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.