Open In App

Underscore.js Objects Complete Reference

Last Updated : 01 Aug, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Underscore provides a number of common object related methods such as the key and values  functions.  These functions are used to return the list of all keys and value of the given object respectively . All the underscore objects examples are given below with their references: 

Function

Description

_.keys() It returns the list of all keys of the given object.
_.allKeys() It returns all keys of the object and inherited properties.
_.values() It returns the list of all values of the object element.
_.mapObject() It transforms each value of the object based on the given function/operation.
_.pairs() It converts an object into [key, value] pairs.
_.invert() It returns the copy of object where object key is converted into value and object value is converted into key.
_.create() It creates a new object with the stated prototype and props, as its own property which is attached optionally.
_.functions() It returns the sorted list of all methods that present in an object.
_.findKey() It returns the key value where the predicate logic or condition returns the truth value or undefined.
_.extend() It creates a copy of all of the properties of the source objects over the destination object.
_.extendOwn() It is used to copy only own properties over to the destination object.
_.pick() It returns a copy of the object that filtered using the given key.
_.omit() It returns a copy of the object that filtered to omit the blacklisted keys.
_.defaults() It returns the object after filling in its undefined properties.
_.clone() It creates a shallow copy of the given object.
_.tap() It is used to call interceptor with the stated object.
_.property() It returns a function that will return the specified property of any passed-in object.
_.propertyOf() It takes an object as an argument and returns a function that will return the value of a provided property.
_.matcher() It tells if a passed in object includes all the key-value properties that are given in the attrs parameter.
_.isEqual() It finds whether the 2 given arrays are the same or not.
_.isMatch() It finds out if the property given in argument is present in the passed array or not.
_.isEmpty() It checks whether a list, array, string, object etc is empty or not.
_.isElement() It checks whether the element is a document object model or not.
_.isArray() It finds whether the passed argument is an array or not.
_.isObject() It checks whether the given object is an object or not.
_.isArguments() It checks whether the given object is an argument or not.
_.isFunction() It checks whether the given object is function or not.
_.isString() It checks whether the given object element is string or not.
_.isNumber() It checks whether the given object parameter is number or not.
_.isFinite() It checks whether the value of the parameter passed is finite or not.
_.isBoolean() It finds whether the element passed is true/ false or something else.
_.isDate() It is used to tell if the given object is a date object or not.
_.isRegExp() It finds whether the object passed is a regular expression or not.
_.isError() It checks whether the given object is javascript Error Object or not.
_.isSymbol() It checks whether the given object is javascript Symbol Object or not.
_.isMap() It checks whether the given object is javascript Map or not.
_.isWeakMap() It checks whether the given object is javascript weakmap or not.
_.isSet() It checks whether the given object is javascript set or not.
_.isWeakSet() It checks whether the given object is JavaScript weakset or not.
_.isArrayBuffer() It checks if the stated object is an ArrayBuffer or not.
_.isNaN() It is used to find whether the value of the object passed is NaN or not.
_.isNull() It is used to find whether the value of the object is null.
_.isUndefined() It checks if the parameter passed to it is undefined or not.

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads