Functions
Browse all available utility functions by category
assign
Assigns own enumerable string keyed properties of source objects to the destination object.
Example:
function Foo() {assignIn
This method is like assign except that it iterates over own and inherited source properties.
Example:
function Foo() {assignInWith
This method is like assignIn except that it accepts customizer which is invoked to produce the assigned values.
Example:
function customizer(objValue: unknown, srcValue: unknown) {assignWith
This method is like assign except that it accepts customizer which is invoked to produce the assigned values.
Example:
function customizer(objValue: unknown, srcValue: unknown) {at
Creates an array of values corresponding to paths of object.
Example:
const object = { 'a': [{ 'b': { 'c': 3 } }, 4] };create
Creates an object that inherits from the prototype object.
Example:
function Shape() {defaults
Assigns own enumerable string keyed properties of source objects to the destination object for all destination properties that resolve to undefined.
Example:
defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); // { 'a': 1, 'b': 2 }defaultsDeep
This method is like defaults except that it recursively assigns default properties.
Example:
defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); // { 'a': { 'b': 2, 'c': 3 } }entries
Creates an array of own enumerable string keyed-value pairs for object.
Example:
function Foo() {entriesIn
Creates an array of own and inherited enumerable string keyed-value pairs for object.
Example:
function Foo() {extend
Assigns own enumerable string keyed properties of source objects to the destination object. This is an alias for assignIn.
Example:
extend({ 'a': 1 }, { 'b': 2 }); // { 'a': 1, 'b': 2 }extendWith
This method is like extend except that it accepts customizer which is invoked to produce the assigned values.
Example:
function customizer(objValue: unknown, srcValue: unknown) {findKey
This method is like find except that it returns the key of the first element predicate returns truthy for instead of the element itself.
Example:
const users = {findLastKey
This method is like findKey except that it iterates over elements of a collection in the opposite order.
Example:
const users = {forIn
Iterates over own and inherited enumerable string keyed properties of an object and invokes iteratee for each property.
Example:
function Foo() {forInRight
This method is like forIn except that it iterates over properties of object in the opposite order.
Example:
function Foo() {forOwn
Iterates over own enumerable string keyed properties of an object and invokes iteratee for each property.
Example:
function Foo() {forOwnRight
This method is like forOwn except that it iterates over properties of object in the opposite order.
Example:
function Foo() {functions
Creates an array of function property names from own enumerable properties of object.
Example:
function Foo() {functionsIn
Creates an array of function property names from own and inherited enumerable properties of object.
Example:
function Foo() {get
Gets the value at path of object.
Example:
const object = { 'a': [{ 'b': { 'c': 3 } }] };has
Checks if path is a direct property of object.
Example:
const object = { 'a': { 'b': 2 } };hasIn
Checks if path is a direct or inherited property of object.
Example:
const object = Object.create({ 'a': Object.create({ 'b': 2 }) });invert
Creates an object composed of the inverted keys and values of object.
Example:
const object = { 'a': 1, 'b': 2, 'c': 1 };invertBy
This method is like invert except that the inverted object is generated from the results of running each element of object thru iteratee.
Example:
const object = { 'a': 1, 'b': 2, 'c': 1 };invoke
Invokes the method at path of object.
Example:
const object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };keys
Creates an array of the own enumerable property names of object.
Example:
function Foo() {keysIn
Creates an array of the own and inherited enumerable property names of object.
Example:
function Foo() {mapKeys
Creates an object with the same values as object and keys generated by running each own enumerable string keyed property of object thru iteratee.
Example:
mapKeys({ 'a': 1, 'b': 2 }, (value, key) => key + value); // { 'a1': 1, 'b2': 2 }mapValues
Creates an object with the same keys as object and values generated by running each own enumerable string keyed property of object thru iteratee.
Example:
const users = {merge
Recursively merges own and inherited enumerable string keyed properties of source objects into the destination object.
Example:
const object = {mergeWith
This method is like merge except that it accepts customizer which is invoked to produce the merged values of the destination and source properties.
Example:
function customizer(objValue: unknown, srcValue: unknown) {omit
Creates an object composed of the own and inherited enumerable property paths of object that are not omitted.
Example:
const object = { 'a': 1, 'b': '2', 'c': 3 };omitBy
Creates an object composed of the own and inherited enumerable string keyed properties of object that predicate doesn't return truthy for.
Example:
const object = { 'a': 1, 'b': '2', 'c': 3 };pick
Creates an object composed of the picked object properties.
Example:
const object = { 'a': 1, 'b': '2', 'c': 3 };pickBy
Creates an object composed of the object properties predicate returns truthy for.
Example:
const object = { 'a': 1, 'b': '2', 'c': 3 };result
This method is like get except that if the resolved value is a function it's invoked with the this binding of its parent object and its result is returned.
Example:
const object = { 'a': [{ 'b': { 'c1': 3, 'c2': () => 4 } }] };set
Sets the value at path of object.
Example:
const object = { 'a': [{ 'b': { 'c': 3 } }] };setWith
This method is like set except that it accepts customizer which is invoked to produce the objects of path.
Example:
const object = {};toPairs
Creates an array of own enumerable string keyed-value pairs for object. This is an alias for entries.
Example:
function Foo() {toPairsIn
Creates an array of own and inherited enumerable string keyed-value pairs for object. This is an alias for entriesIn.
Example:
function Foo() {transform
An alternative to reduce; this method transforms object to a new accumulator object which is the result of running each of its own enumerable string keyed properties thru iteratee.
Example:
transform([2, 3, 4], (result, n) => {unset
Removes the property at path of object.
Example:
const object = { 'a': [{ 'b': { 'c': 7 } }] };update
This method is like set except that it accepts updater to produce the value to set.
Example:
const object = { 'a': [{ 'b': { 'c': 3 } }] };updateWith
This method is like update except that it accepts customizer which is invoked to produce the objects of path.
Example:
const object = {};values
Creates an array of the own enumerable string keyed property values of object.
Example:
function Foo() {valuesIn
Creates an array of the own and inherited enumerable string keyed property values of object.
Example:
function Foo() {