Underscore.js Object Methods

Beginner
7 min read
Updated: Nov 2026
46 method guides
Method index

About This Index

This page is the Underscore.js Objects index for the tutorial track. Each row links to a full guide with syntax, examples, and FAQs.

Learn collections and functions on /underscore-js/collection and /underscore-js/function. Use this page when you need an object API such as _.keys(), _.extend(), or _.isEqual().

Beginner path.

Start with _.keys(), then _.extend(), _.pick(), and _.isEqual()—then browse type checks as needed.

How to Call an Object Method

Pass a plain object (and any extra arguments) to the Underscore helper:

Underscore
const person = { name: "moe", age: 40, job: "comedian" };

_.keys(person);    // ["name", "age", "job"]
_.values(person);  // ["moe", 40, "comedian"]
_.pick(person, "name", "job");  // { name: "moe", job: "comedian" }
_.omit(person, "age");          // { name: "moe", job: "comedian" }

_.extend({ a: 1 }, { b: 2 });   // { a: 1, b: 2 }
_.defaults({ a: 1 }, { a: 0, b: 2 }); // { a: 1, b: 2 }

_.isEqual({ x: 1 }, { x: 1 });  // true
_.isEmpty({});                  // true
_.isArray([1, 2]);              // true

Underscore.js Object Methods Table

All object method guides in this Underscore.js tutorial series (46 tutorials).

Getting Started

5 methods

Read keys, values, pairs, and map object properties.

MethodDescriptionTutorial
_.keys()Returns an array of the object's own enumerable property names.Try it
_.allKeys()Returns own and inherited enumerable property names.Try it
_.values()Returns an array of the object's own enumerable property values.Try it
_.mapObject()Maps an object's values, returning a new object with the same keys.Try it
_.pairs()Converts an object into [key, value] pairs.Try it

Build & Inspect

4 methods

Invert maps, create from a prototype, list methods, and find a key.

MethodDescriptionTutorial
_.invert()Returns a copy with keys and values swapped.Try it
_.create()Creates a new object with the given prototype and optional props.Try it
_.functions()Returns a sorted list of the object's own function names (alias: _.methods).Try it
_.findKey()Returns the first key whose value passes a predicate.Try it

Copy & Merge

6 methods

Extend, pick, omit, fill defaults, and shallow-clone.

MethodDescriptionTutorial
_.extend()Copies all enumerable properties onto the destination (including inherited).Try it
_.extendOwn()Copies own enumerable properties onto the destination (alias: _.assign).Try it
_.pick()Returns a copy with only the listed (or predicate-matching) keys.Try it
_.omit()Returns a copy without the listed (or predicate-matching) keys.Try it
_.defaults()Fills in undefined properties on the object with defaults.Try it
_.clone()Creates a shallow copy of the object or array.Try it

Paths & Access

7 methods

Tap chains, resolve paths, has/get, and property helpers.

MethodDescriptionTutorial
_.tap()Invokes interceptor with the object, then returns the object — useful in chains.Try it
_.toPath()Converts a string or array into a standardized property path array.Try it
_.has()Returns true if the object has the listed key as an own property.Try it
_.get()Gets a nested property value by path, or a default if missing.Try it
_.property()Returns a function that reads the given property (or path) from an object.Try it
_.propertyOf()Returns a function that reads properties from a fixed object.Try it
_.matcher()Returns a predicate that is true when an object matches the attrs (alias: _.matches).Try it

Compare & Empty

3 methods

Deep equality, partial matches, and emptiness checks.

MethodDescriptionTutorial
_.isEqual()Performs a deep comparison between two values.Try it
_.isMatch()Returns true if the object contains the given key–value pairs.Try it
_.isEmpty()Returns true if the object, array, or string has no enumerable values.Try it

Core Type Checks

12 methods

Test arrays, objects, functions, strings, numbers, null, and undefined.

MethodDescriptionTutorial
_.isElement()Returns true if the value is a DOM element.Try it
_.isArray()Returns true if the value is an array.Try it
_.isObject()Returns true if the value is an object (including functions and arrays).Try it
_.isArguments()Returns true if the value is an arguments object.Try it
_.isFunction()Returns true if the value is a function.Try it
_.isString()Returns true if the value is a string.Try it
_.isNumber()Returns true if the value is a number (including NaN).Try it
_.isNaN()Returns true if the value is NaN — stricter than the native isNaN.Try it
_.isNull()Returns true if the value is null.Try it
_.isUndefined()Returns true if the value is undefined.Try it
_.isFinite()Returns true if the value is a finite number.Try it
_.isBoolean()Returns true if the value is a boolean.Try it

Built-in Type Checks

9 methods

Dates, regexps, errors, symbols, maps, and binary views.

MethodDescriptionTutorial
_.isDate()Returns true if the value is a Date.Try it
_.isRegExp()Returns true if the value is a RegExp.Try it
_.isError()Returns true if the value is an Error.Try it
_.isSymbol()Returns true if the value is a Symbol.Try it
_.isMap()Returns true if the value is a Map.Try it
_.isWeakMap()Returns true if the value is a WeakMap.Try it
_.isArrayBuffer()Returns true if the value is an ArrayBuffer.Try it
_.isDataView()Returns true if the value is a DataView.Try it
_.isTypedArray()Returns true if the value is a TypedArray.Try it

Frequently Asked Questions

They help with plain objects: listing keys and values (_.keys, _.values), copying and subsetting (_.extend, _.pick, _.omit, _.defaults), deep equality (_.isEqual), and type checks (_.isArray, _.isFunction, and more).
Readers like _.keys and _.pick return new data. Mergers like _.extend and _.defaults write onto the destination object. _.clone is a shallow copy—nested objects are still shared.
_.keys returns only own enumerable names. _.allKeys also includes enumerable names inherited from the prototype chain.
Use _.pick when you know the keys to keep. Use _.omit when you know the keys to drop. Both can also take a predicate function.
Start with _.keys(), then _.extend(), _.pick(), and _.isEqual() from the table below.

Start with _.keys()

Open the keys guide—syntax, examples, and FAQs.

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

14 people found this page helpful