Optional
iteratee: Iteratee<V, boolean, TypeOfCollection<V, never>>Optional
context: anysome
Optional
iteratee: Iteratee<V, boolean, TypeOfCollection<V, never>>Optional
context: anymap
Optional
context: anyfind
Optional
iteratee: Iteratee<V, boolean, TypeOfCollection<V, never>>Optional
context: anyrest
Optional
n: numberreduce
Optional
context: anyreduce
reduceRight
Optional
context: anyreduceRight
each
Optional
context: anyfirst
first
contains
Optional
fromIndex: numbercontains
Optional
fromIndex: numberreduce
Optional
context: anyreduce
filter
Optional
iteratee: Iteratee<V, boolean, TypeOfCollection<V, never>>Optional
context: anyrest
Optional
n: numberfirst
first
uniq
Optional
isSorted: booleanOptional
iteratee: Iteratee<V, any, TypeOfCollection<V, never>>Optional
cotext: anyuniq
Optional
iteratee: Iteratee<V, any, TypeOfCollection<V, never>>Optional
context: anyReturns true if the value is present in the wrapped collection. Uses
indexOf internally, if the wrapped collection is a List. Use
fromIndex
to start your search at a given index.
True if value
is present in the wrapped collection after
fromIndex
, otherwise false.
The value to check the wrapped collection for.
Optional
fromIndex: numberThe index to start searching from, optional, default = 0, only used when the wrapped collection is a List.
Sorts the wrapped collection into groups and returns a count for the
number of objects in each group. Similar to groupBy
, but instead
of returning a list of values, returns a count for the number of
values in that group.
A dictionary with the group names provided by iteratee
as
properties where each property contains the count of the grouped
elements from the wrapped collection.
Optional
iteratee: Iteratee<V, string | number, TypeOfCollection<V, never>>An iteratee that provides the value to count by for each item in the wrapped collection.
Optional
context: anythis
object in iteratee
, optional.
Wrapped type Function
.
_.debounce
Optional
immediate: booleanSimilar to without, but returns the values from the wrapped list
that are not present in others
.
The contents of the wrapped list without the values in
others
.
Rest
...others: List<T>[]The lists of values to exclude from the wrapped list.
Iterates over the wrapped collection of elements, yielding each in
turn to an iteratee
. The iteratee
is bound to the context object,
if one is passed.
The originally wrapped collection.
The iteratee to call for each element in the wrapped collection.
Optional
context: any'this' object in iteratee
, optional.
Returns true if all of the values in the wrapped collection pass the
iteratee
truth test. Short-circuits and stops traversing the
wrapped collection if a false element is found.
True if all elements pass the truth test, otherwise false.
Optional
iteratee: Iteratee<V, boolean, TypeOfCollection<V, never>>The truth test to apply.
Optional
context: anythis
object in iteratee
, optional.
Looks through each value in the wrapped collection, returning an
array of all the values that pass a truth test (iteratee
).
The set of values that pass the truth test.
Optional
iteratee: Iteratee<V, boolean, TypeOfCollection<V, never>>The truth test to apply.
Optional
context: anythis
object in iteratee
, optional.
Looks through each value in the wrapped collection, returning the
first one that passes a truth test (iteratee
), or undefined if no
value passes the test. The function returns as soon as it finds an
acceptable element, and doesn't traverse the entire collection.
The first element in the wrapped collection that passes the truth test or undefined if no elements pass.
Optional
iteratee: Iteratee<V, boolean, TypeOfCollection<V, never>>The truth test to apply.
Optional
context: anythis
object in iteratee
, optional.
Returns the first index of an element in the wrapped list where the
iteratee
truth test passes, otherwise returns -1.
The index of the first element in the wrapped list where the truth test passes or -1 if no elements pass.
Optional
iteratee: Iteratee<V, boolean, TypeOfCollection<V, never>>The truth test to apply.
Optional
context: anythis
object in iteratee
, optional.
Similar to findIndex
but for keys in objects. Returns the key
where the iteratee
truth test passes or undefined.
The first element in the wrapped object that passes the truth test or undefined if no elements pass.
Optional
iteratee: Iteratee<V, boolean, TypeOfCollection<V, any>>The truth test to apply.
Optional
context: anythis
object in iteratee
, optional.
Returns the last index of an element in the wrapped list where the
iteratee
truth test passes, otherwise returns -1.
The index of the last element in the wrapped list where the truth test passes or -1 if no elements pass.
Optional
iteratee: Iteratee<V, boolean, TypeOfCollection<V, never>>The truth test to apply.
Optional
context: anythis
object in iteratee
, optional.
Looks through the wrapped collection and returns the first value
that matches all of the key-value pairs listed in properties
. If
no match is found, or if list is empty, undefined will be returned.
The first element in the wrapped collection that matches
properties
or undefined if no match is found.
The properties to check for on the elements within the wrapped collection.
Flattens a nested list (the nesting can be to any depth). If you pass depth, the wrapped list will only be flattened a single level.
The flattened list.
True to only flatten one level, optional, default = false.
Optional
depth: number | falseWrapped type any
.
_.get
Optional
defaultValue: USplits the warpped collection into sets that are grouped by the
result of running each value through iteratee
.
A dictionary with the group names provided by iteratee
as
properties where each property contains the grouped elements from
the wrapped collection.
Optional
iteratee: Iteratee<V, string | number, TypeOfCollection<V, never>>An iteratee that provides the value to group by for each item in the wrapped collection.
Optional
context: anythis
object in iteratee
, optional.
Given the warpped collection and an iteratee
function that returns
a key for each element in the wrapped collection, returns an object
that acts as an index of each item. Just like groupBy
, but for when you
know your keys are unique.
A dictionary where each item in the wrapped collection is
assigned to the property designated by iteratee
.
Optional
iteratee: Iteratee<V, string | number, TypeOfCollection<V, never>>An iteratee that provides the value to index by for each item in the wrapped collection.
Optional
context: anythis
object in iteratee
, optional.
Returns the index at which value
can be found in the wrapped list,
or -1 if value
is not present. If you're working with a large list
and you know that the list is already sorted, pass true for
isSortedOrFromIndex
to use a faster binary search...or, pass a
number in order to look for the first matching value in the list
after the given index.
The index of the first occurrence of value
within the
wrapped list or -1 if value
is not found.
The value to search for within the wrapped list.
Optional
isSortedOrFromIndex: number | booleanTrue if the wrapped list is already sorted OR the starting index for the search, optional.
Returns everything but the last entry of the wrapped list.
Especially useful on the arguments object. Pass n
to exclude the
last n
elements from the result.
The elements of the wrapped list with the last n
items
omitted.
Optional
n: numberThe number of elements from the end of the wrapped list to omit, optional, default = 1.
Computes the list of values that are the intersection of the wrapped
list and the passed-in lists
. Each value in the result is present
in each of the lists.
The intersection of elements within the the wrapped list
and lists
.
Rest
...lists: List<T>[]The lists (along with the wrapped list) to compute the intersection of.
Calls the method named by methodName
on each value in the wrapped
collection. Any extra arguments passed to invoke will be forwarded
on to the method invocation.
An array containing the result of the method call for each item in the wrapped collection.
The name of the method to call on each element in the wrapped collection.
Rest
...args: any[]Additional arguments to pass to method methodName
.
Returns the index of the last occurrence of value
in the wrapped
list, or -1 if value
is not present. Pass fromIndex
to start
your search at a given index.
The index of the last occurrence of value
within the
wrapped list or -1 if value
is not found.
The value to search for within the wrapped list.
Optional
fromIndex: numberThe starting index for the search, optional.
Produces a new array of values by mapping each value in the wrapped
collection through a transformation iteratee
.
The mapped result.
The iteratee to use to transform each item in the wrapped collection.
Optional
context: anythis
object in iteratee
, optional.
Like map, but for objects. Transform the value of each property in turn.
A new object with all of the wrapped object's property
values transformed through iteratee
.
The iteratee to use to transform property values.
Optional
context: anythis
object in iteratee
, optional.
Wrapped type any[]
.
_.matcher
Wrapped type any[]
.
_.matches
Returns the maximum value in the wrapped collection. If an
iteratee
is provided, it will be used on each element to generate
the criterion by which the element is ranked. -Infinity is returned
if list is empty. Non-numerical values returned by iteratee
will
be ignored.
The maximum element within the wrapped collection or -Infinity if the wrapped collection is empty.
Optional
iteratee: Iteratee<V, any, TypeOfCollection<V, never>>The iteratee that provides the criterion by which each element is ranked, optional if evaluating a collection of numbers.
Optional
context: anythis
object in iteratee
, optional.
Returns the minimum value in the wrapped collection. If an
iteratee
is provided, it will be used on each element to generate
the criterion by which the element is ranked. Infinity is returned
if list is empty. Non-numerical values returned by iteratee
will
be ignored.
The minimum element within the wrapped collection or Infinity if the wrapped collection is empty.
Optional
iteratee: Iteratee<V, any, TypeOfCollection<V, never>>The iteratee that provides the criterion by which each element is ranked, optional if evaluating a collection of numbers.
Optional
context: anythis
object in iteratee
, optional.
Converts lists into objects. Call on either a wrapped list of
[key, value] pairs, or a wrapped list of keys and a list of
values
. Passing by pairs is the reverse of pairs. If duplicate
keys exist, the last value wins.
An object comprised of the provided keys and values.
If the wrapped list is a list of keys, a list of values corresponding to those keys.
Return a copy of the wrapped object that is filtered to omit the disallowed keys (or array of keys).
A copy of the wrapped object without the keys
properties.
Rest
...keys: (K | K[])[]The keys to omit from the wrapped object.
Return a copy of the wrapped object that is filtered to not have values for the keys selected by a truth test.
A copy of the wrapped object without the keys selected by
iterator
.
A truth test that selects the keys to omit from the wrapped object.
Convert the wrapped object into a list of [key, value] pairs. The
opposite of the single-argument signature of _.object
.
The list of [key, value] pairs from the wrapped object.
Splits the wrapped collection into two arrays: one whose elements
all satisfy iteratee
and one whose elements all do not satisfy
iteratee
.
An array composed of two elements, where the first element contains the elements in the wrapped collection that satisfied the predicate and the second element contains the elements that did not.
Optional
iteratee: Iteratee<V, boolean, TypeOfCollection<V, never>>The iteratee that defines the partitioning scheme for each element in the wrapped collection.
Optional
context: anythis
object in iteratee
, optional.
Return a copy of the wrapped object that is filtered to only have values for the allowed keys (or array of keys).
A copy of the wrapped object with only the keys
properties.
Rest
...keys: (K | K[])[]The keys to keep on the wrapped object.
Return a copy of the wrapped object that is filtered to only have values for the keys selected by a truth test.
A copy of the wrapped object with only the keys selected by
iterator
.
A truth test that selects the keys to keep on the wrapped object.
A convenient version of what is perhaps the most common use-case for map: extracting a list of property values.
The set of values for the specified propertyName
for each
item in the wrapped collection.
The name of a specific property to retrieve from all items in the wrapped collection.
A function to create flexibly-numbered lists of integers, handy for
each
and map
loops. Returns a list of integers from
the wrapped value (inclusive) to stop
(exclusive), incremented
(or decremented) by step
. Note that ranges that stop
before they
start
are considered to be zero-length instead of negative - if
you'd like a negative range, use a negative step
.
If stop
is not specified, the wrapped value will be the number to
stop at and the default start of 0 will be used.
An array of numbers from start to stop
with increments
of step
.
Optional
stop: numberThe number to stop at.
Optional
step: numberThe number to count up by each iteration, optional, default = 1.
Also known as inject and foldl, reduce boils down the wrapped
collection of values into a single value. memo
is the initial
state of the reduction, and each successive step of it should be
returned by iteratee
.
If no memo is passed to the initial invocation of reduce, iteratee
is not invoked on the first element of the wrapped collection. The
first element is instead passed as the memo in the invocation of
iteratee
on the next element in the wrapped collection.
The reduced result.
The function to call on each iteration to reduce the collection.
The initial reduce state or undefined to use the first
item in collection
as initial state.
Optional
context: anythis
object in iteratee
, optional.
The right-associative version of reduce.
This is not as useful in JavaScript as it would be in a language with lazy evaluation.
The reduced result.
The function to call on each iteration to reduce the collection.
The initial reduce state or undefined to use the first
item in collection
as the initial state.
Optional
context: anythis
object in iteratee
, optional.
Returns the values in the wrapped collection without the elements
that pass a truth test (iteratee
).
The opposite of filter.
The set of values that fail the truth test.
Optional
iteratee: Iteratee<V, boolean, TypeOfCollection<V, never>>The truth test to apply.
Optional
context: anythis
object in iteratee
, optional.
Produce a random sample from the wrapped collection. Pass a number
to return n
random elements from the wrapped collection. Otherwise
a single random item will be returned.
A random sample of n
elements from the wrapped collection
or a single element if n
is not specified.
The number of elements to sample from the wrapped collection.
Returns true if any of the values in the wrapped collection pass the
iteratee
truth test. Short-circuits and stops traversing the
wrapped collection if a true element is found.
True if any element passed the truth test, otherwise false.
Optional
iteratee: Iteratee<V, boolean, TypeOfCollection<V, never>>The truth test to apply.
Optional
context: anythis
object in iteratee
, optional.
Returns a (stably) sorted copy of the wrapped collection, ranked in
ascending order by the results of running each value through
iteratee
.
A sorted copy of the wrapped collection.
Optional
iteratee: Iteratee<V, any, TypeOfCollection<V, never>>An iteratee that provides the value to sort by for each item in the wrapped collection.
Optional
context: anythis
object in iteratee
, optional.
Uses a binary search to determine the lowest index at which the value should be inserted into the wrapped list in order to maintain the wrapped list's sorted order. If an iteratee is provided, it will be used to compute the sort ranking of each value, including the value you pass.
The index where value
should be inserted into the wrapped
list.
The value to determine an insert index for to mainain the sorting in the wrapped list.
Optional
iteratee: Iteratee<undefined | V, any, TypeOfCollection<V, never>>Iteratee to compute the sort ranking of each
element including value
, optional.
Optional
context: anythis
object in iteratee
, optional.
Wrapped type string
.
_.template
Optional
settings: TemplateSettingsWrapped type Function
.
_.throttle
Optional
options: ThrottleSettingsComputes the union of the wrapped list and the passed-in lists
:
the list of unique items, examined in order from first list to last
list, that are present in one or more of the lists.
The union of elements within the wrapped list and lists
.
Rest
...lists: List<T>[]The lists (along with the wrapped list) to compute the union of.
Produces a duplicate-free version of the wrapped list, using === to test object equality. If you know in advance that the wrapped list is sorted, passing true for isSorted will run a much faster algorithm. If you want to compute unique items based on a transformation, pass an iteratee function.
An array containing only the unique elements in the wrapped list.
Optional
isSorted: booleanTrue if the wrapped list is already sorted, optional, default = false.
Optional
iteratee: Iteratee<V, any, TypeOfCollection<V, never>>Transform the elements of the wrapped list before comparisons for uniqueness.
Optional
cotext: anyOptional
iteratee: Iteratee<V, any, TypeOfCollection<V, never>>Optional
context: anyThe opposite of zip. Given the wrapped list of lists, returns a series of new arrays, the first of which contains all of the first elements in the wrapped lists, the second of which contains all of the second elements, and so on. (alias: transpose)
The unzipped version of the wrapped lists.
Looks through each value in the wrapped collection, returning an
array of all the elements that match the key-value pairs listed in
properties
.
The elements in the wrapped collection that match
properties
.
The properties to check for on the elements within the wrapped collection.
Merges together the values of each of the lists
(including the
wrapped list) with the values at the corresponding position. Useful
when you have separate data sources that are coordinated through
matching list indexes.
The zipped version of the wrapped list and lists
.
Rest
...lists: List<any>[]
See
every