chunk
Creates an array of elements split into groups the length of size. If array can't be split evenly, the final chunk will be the remaining elements.
Category
Utilities for working with arrays
39 utilities available
Creates an array of elements split into groups the length of size. If array can't be split evenly, the final chunk will be the remaining elements.
Creates an array with all falsy values removed. The values false, null, 0, "", undefined, and NaN are falsy.
Flattens array a single level deep.
Recursively flattens array to a single level.
Creates a duplicate-free version of an array, using SameValueZero for equality comparisons.
Creates a duplicate-free version of an array using a comparator function to determine uniqueness.
Fills elements of array with value from start up to, but not including, end.
Returns the index of the first element predicate returns truthy for instead of the element itself.
This method is like findIndex except that it iterates over elements of collection from right to left.
Gets the first element of array. Alias for head.
Recursively flatten array up to depth times.
The inverse of toPairs; this method returns an object composed from key-value pairs.
Gets the first element of array.
Gets the index at which the first occurrence of value is found in array.
Converts all elements in array into a string separated by separator.
Gets the last element of array.
This method is like indexOf except that it iterates over elements of array from right to left.
Gets the element at index n of array. If n is negative, the nth element from the end is returned.
Removes all given values from array using SameValueZero for equality comparisons.
This method is like pull except that it accepts an array of values to remove.
This method is like pullAll except that it accepts iteratee which is invoked for each element of array and values to generate the criterion by which they're compared.
This method is like pullAll except that it accepts comparator which is invoked to compare elements of array to values.
Removes elements from array corresponding to indexes and returns an array of removed elements.
Removes all elements from array that predicate returns truthy for and returns an array of the removed elements.
Reverses array so that the first element becomes the last, the second element becomes the second to last, and so on.
Creates a slice of array from start up to, but not including, end.
Uses a binary search to determine the lowest index at which value should be inserted into array in order to maintain its sort order.
This method is like sortedIndex except that it accepts iteratee which is invoked for value and each element of array to compute their sort ranking.
This method is like indexOf except that it performs a binary search on a sorted array.
This method is like sortedIndex except that it returns the highest index at which value should be inserted into array in order to maintain its sort order.
This method is like sortedLastIndex except that it accepts iteratee which is invoked for value and each element of array to compute their sort ranking.
This method is like lastIndexOf except that it performs a binary search on a sorted array.
This method is like uniq except that it's designed and optimized for sorted arrays.
This method is like uniqBy except that it's designed and optimized for sorted arrays.
Gets all but the first element of array.
Creates a slice of array with n elements taken from the beginning.
Creates a slice of array with n elements taken from the end.
Creates a slice of array with elements taken from the end. Elements are taken until predicate returns falsey.
Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns falsey.