Lodash _.isArguments() method

Beginner
⏱️ 6 min read
📚 Updated: May 2026
🎯 3 Code examples
🚀 3 Try-it labs
Lodash

What you’ll learn

  • How _.isArguments(value) spots real Arguments objects.
  • Why arrays, plain objects, and copied argument lists usually return false.
  • The difference between the legacy arguments binding and rest-parameter arrays.
  • When modern rest syntax replaces the need for this check.

Prerequisites

Know that non-arrow functions expose an arguments object and that array-like values are not always Arrays.

  • You can run short snippets inside plain function () { … } bodies.
  • You can open Try-it labs in the browser.

Overview

_.isArguments answers a narrow question: “Is this value the engine’s Arguments object?” That matters when you write helpers that accept variadic inputs and must branch between Arguments-like collections and real arrays.

True Arguments only

Designed for the legacy binding inside ordinary functions—not arbitrary plain objects.

Not Array.isArray

Arrays fail this check even when they mirror argument indexes.

Rest replaces many uses

(...args) gives a real Array, sidestepping Arguments-specific detection.

Syntax

javascript
_.isArguments(value)
  • value: any value to test.
  • Returns: true if value is an Arguments object; otherwise false.
1

Classic function: real Arguments object

Inside an ordinary function, arguments is what _.isArguments is built to recognize.

javascript
import isArguments from "lodash/isArguments";

function demo() {
  return isArguments(arguments);
}

demo(1, 2, 3);        // true
Try it Yourself
2

After Array.from or spread: no longer Arguments

Copying into a real Array drops the Arguments branding—use Array.isArray or accept Arrays directly instead.

javascript
import isArguments from "lodash/isArguments";

function demo() {
  var arr = Array.from(arguments);
  return isArguments(arr);
}

demo(1, 2);           // false
Try it Yourself
3

Rest parameters, arrays, and plain objects

Rest bundles parameters into an Array. Ordinary arrays and objects are never classified as Arguments.

javascript
import isArguments from "lodash/isArguments";

function withRest(...items) {
  return isArguments(items);
}

withRest(1);          // false

isArguments([]);      // false
isArguments({ 0: "a", length: 1 }); // false
Try it Yourself

📋 _.isArguments vs other checks

CheckTypical use
_.isArguments(x)Detect the engine Arguments object from legacy functions.
Array.isArray(x)True only for real Arrays (including rest-parameter bundles).
_.isPlainObject(x)Plain objects created via Object; not Arguments.

Pitfalls to avoid

Arrows

No local arguments

Arrow functions inherit lexical scope and do not define arguments; avoid assuming it exists.

Copies

Expecting true after conversion

[...arguments], slice, and Array.from yield Arrays—_.isArguments becomes false.

API design

Variadic helpers

Prefer documenting “pass an Array” or using rest parameters so callers rarely need Arguments detection.

❓ FAQ

No. It is array-like (indexed properties and length) but not constructed as Array. _.isArguments returns true only for the special Arguments object from non-arrow functions.
Usually no. Converting arguments into a real array produces an Array instance, and _.isArguments is false for ordinary arrays.
Arrow functions do not have their own arguments binding. There is no Arguments object to inspect unless you reference an outer function's arguments.
Modern style often uses (...args) => with args as a real Array, avoiding Arguments-specific helpers entirely.

Summary

  • Purpose: identify true Arguments objects from classic functions.
  • Not for: generic array-like duck typing—Arrays and copied lists fail.
  • Next: explore more on Lodash _.isArray().
Did you know?

The legacy arguments binding is an array-like object—not an Array instance—so it lacks methods like map until you convert it (for example with Array.from), which also removes the Arguments object tag that _.isArguments looks for.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful