For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/fp.md.

Functional

add
Creates a function that adds a number to its input.
at
Creates a function that returns the values at the given indices.
cartesianProduct
Creates a function that computes the Cartesian product with the piped array.
chunk
Creates a function that splits an array into sub-arrays of a given length.
chunkBy
Creates a function that splits adjacent values whenever a key changes.
combinations
Creates a function that returns combinations of a given size.
compact
Creates a function that removes falsey values from an array.
countBy
Creates a function that counts values by a key.
difference
Creates a function that excludes values found in another array.
differenceBy
Creates a function that excludes values by a mapped key.
differenceWith
Creates a function that excludes values using a custom equality function.
drop
Creates a function that drops values from the beginning of an array.
dropRight
Creates a function that drops values from the end of an array.
dropRightWhile
Creates a function that drops trailing values while a predicate passes.
dropWhile
Creates a function that drops leading values while a predicate passes.
filter
Creates a function that keeps only the elements that pass a test, equivalent to Array.prototype.filter.
find
Creates a function that returns the first value that passes a test.
findIndex
Creates a function that returns the index of the first value that passes a test.
findLast
Creates a function that returns the last value that passes a test.
findLastIndex
Creates a function that returns the index of the last value that passes a test.
flatMap
Creates a function that maps each value to an array and flattens the result by one level.
flatMapDeep
Creates a function that maps each value and deeply flattens the result.
flatten
Creates a function that flattens nested arrays to a given depth.
flattenDeep
Creates a function that recursively flattens nested arrays.
flow
Performs left-to-right function composition, returning a reusable function instead of running immediately.
forEach
Creates a function that runs a callback for each value and returns the input array.
groupBy
Creates a function that groups values by a key.
head
Creates a function that returns the first value of an array.
initial
Creates a function that returns all values except the last one.
intersection
Creates a function that keeps values found in another array.
intersectionBy
Creates a function that keeps values by a mapped key.
intersectionWith
Creates a function that keeps values using a custom equality function.
isSubset
Creates a function that checks whether the piped array is a subset of another array.
isSubsetWith
Creates a function that checks subset membership using a custom equality function.
join
Creates a function that joins array values into a string.
keyBy
Creates a function that builds an object keyed by each value.
last
Creates a function that returns the last value of an array.
length
Creates a function that returns the length of an array.
map
Creates a function that transforms every element of an array, equivalent to Array.prototype.map.
maxBy
Creates a function that returns the value with the largest computed score.
minBy
Creates a function that returns the value with the smallest computed score.
multiply
Creates a function that multiplies its input by a number.
omit
Creates a function that removes the given keys from an object.
orderBy
Creates a function that sorts objects by criteria and sort orders.
partition
Creates a function that splits values into passing and failing groups.
pick
Creates a function that keeps only the given keys of an object.
pipe
Performs left-to-right function composition, threading a value through a sequence of functions.
reverse
Creates a function that returns a reversed copy of an array.
sample
Creates a function that returns a random value from an array.
sampleSize
Creates a function that returns random values from an array.
shuffle
Creates a function that returns a shuffled copy of an array.
sortBy
Creates a function that sorts an array of objects in ascending order by one or more criteria.
tail
Creates a function that returns all values except the first one.
take
Creates a function that returns the first count elements of an array.
takeRight
Creates a function that returns values from the end of an array.
takeRightWhile
Creates a function that takes trailing values while a predicate passes.
takeWhile
Creates a function that takes leading values while a predicate passes.
toFilled
Creates a function that returns a filled copy of an array.
union
Creates a function that combines two arrays without duplicate values.
unionBy
Creates a function that combines arrays by a mapped key without duplicates.
unionWith
Creates a function that combines arrays using a custom equality function.
uniq
Creates a function that removes duplicate values from an array.
uniqBy
Creates a function that removes duplicates by a mapped key.
uniqWith
Creates a function that removes duplicates using a custom equality function.
unzip
Creates a function that regroups zipped arrays by position.
unzipWith
Creates a function that regroups zipped arrays and combines each position.
windowed
Creates a function that returns sliding windows from an array.
without
Creates a function that removes specific values from an array.
xor
Creates a function that returns values that appear in exactly one of two arrays.
xorBy
Creates a function that returns the symmetric difference by a mapped key.
xorWith
Creates a function that returns the symmetric difference using a custom equality function.
zip
Creates a function that groups values from arrays by index.
zipObject
Creates a function that builds an object from keys and values.
zipWith
Creates a function that combines values from arrays by index.