Underscore.js Object Methods

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().
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:
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 methodsRead keys, values, pairs, and map object properties.
| Method | Description | Tutorial |
|---|---|---|
_.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 methodsInvert maps, create from a prototype, list methods, and find a key.
| Method | Description | Tutorial |
|---|---|---|
_.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 methodsExtend, pick, omit, fill defaults, and shallow-clone.
| Method | Description | Tutorial |
|---|---|---|
_.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 methodsTap chains, resolve paths, has/get, and property helpers.
| Method | Description | Tutorial |
|---|---|---|
_.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 methodsDeep equality, partial matches, and emptiness checks.
| Method | Description | Tutorial |
|---|---|---|
_.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 methodsTest arrays, objects, functions, strings, numbers, null, and undefined.
| Method | Description | Tutorial |
|---|---|---|
_.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 methodsDates, regexps, errors, symbols, maps, and binary views.
| Method | Description | Tutorial |
|---|---|---|
_.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
Start with _.keys()
Open the keys guide—syntax, examples, and FAQs.
14 people found this page helpful
