Lodash _.isArray() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Lang

Definition

Checks if value is classified as an Array object — a real Array instance. In Lodash 4 this matches Array.isArray. Part of Lodash Lang since 0.1.0 (stable — not deprecated).

Pass the value you want to inspect or convert. Read the return type carefully before you use the result.

Syntax

Call _.isArray. Start with this line.

Lodash
_.isArray(value)
CallWhat it does
_.isArray(value)Primary signature.

Prefer import isArray from "lodash/isArray" when you want a smaller bundle.

Library declarations
Lodash
_.isArray(value)

Parameters

ParameterDescription
valueRequired. The value to check

Return Value

Return ValueDescription
*true if Array, else false

Lodash Examples

Example 1 — Official: Real Array

A normal array literal is classified as an Array.

Lodash
_.isArray([1, 2, 3]);
// → true
Try It Yourself

How It Works

  1. Input. Official sample: [1, 2, 3].
  2. Type. Created as a real Array instance.
  3. Result. true.
  4. Native. Same answer as Array.isArray([1, 2, 3]).

Example 2 — Official: String

Strings have length and indexes, but they are not Arrays.

Lodash
_.isArray("abc");
// → false
Try It Yourself

How It Works

  1. Looks similar. "abc".length is 3.
  2. Wrong type. It is a string, not an Array.
  3. Result. false.
  4. Array-like? _.isArrayLike("abc") is true.

Example 3 — Empty Array Still Counts

Emptiness does not matter — only the Array type does.

Lodash
_.isArray([]);
// → true

_.isArray(new Array());
// → true
Try It Yourself

How It Works

  1. Empty literal. [] is still an Array → true.
  2. Constructor. new Array() is also an Array → true.
  3. Contrast empty. Use _.isEmpty if you care about contents.
  4. Guard. Safe default before calling Array methods.

Example 4 — Arguments Are Not Arrays

The classic arguments object is array-like, not an Array.

Lodash
var args = (function () { return arguments; })(1, 2, 3);

_.isArray(args);       // → false
_.isArguments(args);   // → true
_.isArrayLike(args);   // → true
Try It Yourself

How It Works

  1. isArray. Arguments are not Array instances → false.
  2. isArguments. Detects the special Arguments tag → true.
  3. isArrayLike. Indexed keys + length → true.
  4. Convert. Use _.toArray(args) before Array methods.

Example 5 — Array-Like Objects Fail

Looking like an array is not enough — the type must be Array.

Lodash
var like = { 0: "a", 1: "b", length: 2 };

_.isArray(like);      // → false
_.isArrayLike(like);  // → true
Try It Yourself

How It Works

  1. Shape. Numeric keys and length mimic an array.
  2. Type. It is still a plain object → isArray is false.
  3. Duck typing. isArrayLike accepts the shape → true.
  4. Pick. Use isArray when you need real Array methods.

Browser & Runtime Support

_.isArray is a Lodash Lang helper (available since 0.1.0, stable in 4.x). In modern engines it aligns with native Array.isArray. It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash.

✓ Stable · Lodash 0.1.0+

_.isArray()

Available in [email protected] full builds and the lodash/isArray modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.

100% With Lodash 4.x
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
_.isArray Lodash 0.1.0+

Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import isArray from "lodash/isArray" for smaller builds. Native Array.isArray is equivalent in modern runtimes when you do not need Lodash.

Frequently Asked Questions

_.isArray(value) returns true if value is classified as an Array object — a real Array instance — otherwise false.
In Lodash 4 on ordinary JavaScript runtimes, yes. Lodash forwards to Array.isArray, so results match for typical Array instances.
Array detection is not duck typing. Plain objects can look array-like but still fail _.isArray. Use _.isArrayLike if you only need indexed keys plus length.
No. Typed arrays and Arguments are different built-ins. Use _.isTypedArray or _.isArguments for those types.
Yes. _.isArray([]) is true — emptiness does not matter, only the Array type.
Use import isArray from "lodash/isArray" or require("lodash/isArray") for tree-shaking friendly bundles. Full build: import _ from "lodash" then _.isArray.

Next: _.isArrayBuffer()

Check whether a value is an ArrayBuffer instance.

_.isArrayBuffer() tutorial →

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.

10 people found this page helpful