Lodash _.isObjectLike() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Lang

Definition

Checks if value is object-like: not null and typeof result is "object". Part of Lodash Lang (stable — not deprecated). Note: functions fail here — use _.isObject when callables should pass.

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

Syntax

Call _.isObjectLike. Start with this line.

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

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

Library declarations
Lodash
_.isObjectLike(value)

Parameters

ParameterDescription
valueRequired. Value to check

Return Value

Return ValueDescription
*true if object-like, else false

Lodash Examples

Example 1 — Official: Objects, Arrays, Functions, null

typeof-object values pass; functions and null fail.

Lodash
console.log(_.isObjectLike({}));        // true
console.log(_.isObjectLike([1, 2, 3])); // true
console.log(_.isObjectLike(_.noop));    // false
console.log(_.isObjectLike(null));      // false
Try It Yourself

How It Works

  1. Plain object. typeof object → true.
  2. Array. Still typeof object → true.
  3. Function. typeof function → false.
  4. null. Rejected by the non-null guard → false.

Example 2 — isObjectLike vs isObject

The difference is whether functions count.

Lodash
console.log(_.isObjectLike(_.noop)); // false
console.log(_.isObject(_.noop));     // true

console.log(_.isObjectLike({}));     // true
console.log(_.isObject({}));         // true
Try It Yourself

How It Works

  1. Function. isObjectLike requires typeof object → fails.
  2. isObject. Also allows typeof function → passes.
  3. Plain {}. Both helpers agree → true.
  4. Pick. Exclude callables → isObjectLike; include them → isObject.

Example 3 — Fixes the typeof null Quirk

Native typeof lies; Lodash does not.

Lodash
console.log(typeof null);           // "object"
console.log(_.isObjectLike(null));  // false
console.log(_.isObjectLike({}));    // true
Try It Yourself

How It Works

  1. typeof quirk. typeof null reports "object".
  2. Guard. value != null filters null first.
  3. Real object. {} passes.
  4. Use. Safer than bare typeof value === "object".

Example 4 — Dates, Regexes, Boxed Values

Built-in objects with typeof object all pass.

Lodash
console.log(_.isObjectLike(new Date())); // true
console.log(_.isObjectLike(/abc/));      // true
console.log(_.isObjectLike(Object(7)));  // true
console.log(_.isObjectLike(7));          // false
Try It Yourself

How It Works

  1. Date / RegExp. Both are typeof object → true.
  2. Boxed. Object(7) wraps a number as an object → true.
  3. Primitive. Bare 7 is typeof number → false.
  4. Tip. Object-like ≠ plain object — use isPlainObject next if needed.

Example 5 — isObjectLike vs isPlainObject

Many builtins are object-like but not plain objects.

Lodash
console.log(_.isObjectLike([1, 2]));      // true
console.log(_.isPlainObject([1, 2]));     // false

console.log(_.isObjectLike({ a: 1 }));    // true
console.log(_.isPlainObject({ a: 1 }));   // true
Try It Yourself

How It Works

  1. Array. typeof object → object-like true.
  2. Plain check. Arrays are not plain dictionaries → false.
  3. Literal {}. Both helpers accept a simple object.
  4. Use. Wide typeof gate → isObjectLike; config bags → isPlainObject.

Browser & Runtime Support

_.isObjectLike is a Lodash Lang helper available in 4.x (and earlier builds). It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash. Native engines have typeof; Lodash adds the non-null guard so null does not pass.

✓ Stable · Lodash 4.x

_.isObjectLike()

Available in [email protected] full builds and the lodash/isObjectLike 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
_.isObjectLike Lodash 4.x

Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import isObjectLike from "lodash/isObjectLike" for smaller builds. Equivalent to value != null && typeof value === "object".

Frequently Asked Questions

_.isObjectLike(value) returns true when value is not null and typeof value is "object". Arrays, dates, regexes, and boxed primitives pass; functions and null fail.
Functions have typeof "function", not "object". _.isObject allows functions; _.isObjectLike does not.
Yes. Arrays are ordinary objects with typeof "object".
Yes. Object(7) / new Number(7) still have typeof "object" even though they wrap a number.
No. isPlainObject requires a simple Object (or null) prototype. Many builtins that pass isObjectLike fail isPlainObject.
Use import isObjectLike from "lodash/isObjectLike" or require("lodash/isObjectLike") so bundlers can tree-shake unused Lodash code. Full build: import _ from "lodash" then _.isObjectLike.

Next: _.isPlainObject()

Check whether a value is a plain dictionary object.

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