Lodash _.isArrayLike() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Lang

Definition

Checks if value is array-like: not a function, and value.length is an integer from 0 through Number.MAX_SAFE_INTEGER. Part of Lodash Lang since 4.0.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 _.isArrayLike. Start with this line.

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

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

Library declarations
Lodash
_.isArrayLike(value)

Parameters

ParameterDescription
valueRequired. The value to check

Return Value

Return ValueDescription
*true if array-like, else false

Lodash Examples

Example 1 — Official: Array

Real arrays are array-like (and also Arrays).

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

How It Works

  1. Input. Official sample: [1, 2, 3].
  2. Not a function. Arrays pass the first gate.
  3. Length. length is 3 — a valid integer length.
  4. Result. true.

Example 2 — Official: String

Strings are array-like even though they are not Arrays.

Lodash
_.isArrayLike("abc");
// → true

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

How It Works

  1. Length. "abc".length is 3.
  2. isArrayLike. Valid length + not a function → true.
  3. isArray. Strings are not Array instances → false.
  4. Tip. This is the main reason to pick isArrayLike over isArray.

Example 3 — Official: Function Excluded

Functions have length (arity), but Lodash excludes them on purpose.

Lodash
_.isArrayLike(_.noop);
// → false

_.isArrayLike(function (a, b) {});
// → false  (even though length === 2)
Try It Yourself

How It Works

  1. Arity trap. function (a, b) {}.length is 2.
  2. Excluded. Lodash rejects functions before trusting length.
  3. Result. false for both _.noop and the sample function.
  4. Why. Avoid treating every callback as a list.

Example 4 — Arguments Object

Classic arguments is array-like, but not an Array.

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

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

How It Works

  1. Shape. Arguments has indexed keys and length.
  2. isArrayLike. Passes → true.
  3. isArray. Not an Array instance → false.
  4. Convert. Use _.toArray(args) before Array methods.

Example 5 — vs isArrayLikeObject

Strings pass isArrayLike but fail isArrayLikeObject.

Lodash
_.isArrayLike("hi");          // → true
_.isArrayLikeObject("hi");    // → false

_.isArrayLike({ 0: "a", length: 1 });       // → true
_.isArrayLikeObject({ 0: "a", length: 1 }); // → true
Try It Yourself

How It Works

  1. String. Array-like yes; object-like no (primitive).
  2. Shaped object. Both helpers return true.
  3. Pick. Use isArrayLikeObject when strings should not count.
  4. Pick. Use isArrayLike when strings and lists both count.

Browser & Runtime Support

_.isArrayLike is a Lodash Lang helper (added in 4.0.0). It runs anywhere Lodash 4.x runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash.

✓ Stable · Lodash 4.0.0+

_.isArrayLike()

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

100% With Lodash 4.0.0+
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
_.isArrayLike Lodash 4.0.0+

Bottom line: Safe for production once Lodash 4.0.0+ is on the page or in your bundle. Prefer import isArrayLike from "lodash/isArrayLike" for smaller builds. There is no single native Array.isArrayLike — this helper fills that gap.

Frequently Asked Questions

_.isArrayLike(value) returns true if value is not a function and has a length that is an integer from 0 through Number.MAX_SAFE_INTEGER. That covers arrays, strings, Arguments, and many DOM collections.
No. isArray only accepts real Array instances. isArrayLike also accepts strings, Arguments, typed arrays, and plain objects with a valid length.
They expose a non-negative integer length and indexed code units, so collection helpers can iterate them like sequences.
Functions have a length meaning arity (parameter count). Treating every function as array-like would create surprising matches.
isArrayLikeObject also requires a non-primitive object — so strings pass isArrayLike but fail isArrayLikeObject.
Use import isArrayLike from "lodash/isArrayLike" or require("lodash/isArrayLike") for tree-shaking friendly bundles. Full build: import _ from "lodash" then _.isArrayLike.

Next: _.isArrayLikeObject()

Array-like checks that exclude string primitives.

_.isArrayLikeObject() 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