Lodash _.isArrayLikeObject() method

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

What you’ll learn

  • How _.isArrayLikeObject(value) narrows _.isArrayLike to object-like values.
  • Why primitive strings fail here while Arrays and arguments still pass.
  • How boxed strings and typed arrays behave.
  • When to pair with _.isPlainObject or _.isArray.

Prerequisites

You already grasp _.isArrayLike and the difference between object values and primitives.

  • You know primitive strings versus String objects.
  • You can open Try-it labs in the browser.

Overview

Use _.isArrayLikeObject when you want collection-shaped inputs but need to exclude primitives—especially strings—that still look iterable under _.isArrayLike.

Object gate

Filters out non-objects before evaluating length rules.

Strings split

Primitive strings fail; boxed String objects can still pass.

Arrays included

Arrays remain array-like objects—no contradiction with _.isArray.

Syntax

javascript
_.isArrayLikeObject(value)
  • value: any value to test.
  • Returns: true if value is object-like and array-like by Lodash rules; otherwise false.
1

Shaped objects and Arrays—not primitive strings

POJOs with numeric indices plus length qualify, as do Arrays. A string literal is array-like for _.isArrayLike but not object-like, so it stops here.

javascript
import isArrayLikeObject from "lodash/isArrayLikeObject";

isArrayLikeObject({ 0: "x", length: 1 }); // true
isArrayLikeObject([10, 20]);             // true
isArrayLikeObject("hi");                 // false
Try it Yourself
2

Arguments objects versus functions

The legacy arguments object is an ordinary object with indices. Functions remain excluded despite arity length.

javascript
import isArrayLikeObject from "lodash/isArrayLikeObject";

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

demo(1);                                  // true

isArrayLikeObject(function () {});        // false

isArrayLikeObject(null);                  // false
Try it Yourself
3

Typed arrays, boxed strings, and Maps

Typed arrays are objects with element counts. Boxed strings satisfy object-like rules. Associative Maps rely on size, so they fail the array-like length test.

javascript
import isArrayLikeObject from "lodash/isArrayLikeObject";

isArrayLikeObject(new Uint8Array(4));    // true

isArrayLikeObject(Object("ab"));          // true (boxed String)

isArrayLikeObject(new Map());            // false
Try it Yourself

📋 _.isArrayLikeObject vs related helpers

APITypical difference
_.isArrayLikeObject(x)Object-like and array-like; rejects primitive strings.
_.isArrayLike(x)Broader; primitive strings pass.
_.isArray(x)Only true Arrays.
_.isPlainObject(x)Prototype checks for simple objects—not focused on length.

Pitfalls to avoid

Boxing

new String() surprises

Rare in modern code, but object wrappers re-enable array-like detection—stick to primitives at API boundaries when possible.

Semantics

Name overload

“Array-like object” in conversation sometimes means DOM collections; verify whether you truly need Array instances instead.

Sparse

Shape versus content

Passing the check does not guarantee every index exists—business validation still matters.

❓ FAQ

isArrayLikeObject additionally requires Lodash object-like semantics (non-null and typeof object). Primitive strings pass isArrayLike because they have length, but they fail isArrayLikeObject.
Yes. Arrays are objects with length and indices, so both helpers return true for ordinary arrays.
A String object wrapper is object-like and retains indexed length, so it typically passes isArrayLikeObject—prefer primitives consistently or unwrap before type checks.
No—plain-object checks confirm simple POJO prototypes. isArrayLikeObject cares about list-like shape; goals differ.

Summary

  • Purpose: array-like detection limited to object-like values.
  • Key split: primitive strings excluded versus _.isArrayLike.
  • Next: explore more on Lodash _.isBoolean().
Did you know?

_.isArrayLikeObject combines _.isObjectLike with the same length rules as _.isArrayLike. That is why primitive strings fail here even though they pass _.isArrayLike—a string literal is not “object-like” in Lodash’s sense.

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