array1d(length: number) | Creates a one-dimensional array of the specified length. The elements of the array are the numbers from 0 to length - 1. |
chunk(arr: T[], size: number) | Divide array into chunks of size |
clamp(value: number, lower: number, upper: number) | Clamp a number between lower and upper limits |
concat(...args: any[][]) | Concatenate multiple arrays |
count(arr: any[]) | Get the length of the array |
debounce(func: T, wait = 0) | Debounce function calls |
find(arr: T[], predicate: (v: T) => boolean) | Find first element that satisfies the predicate |
findIndex(arr: T[], predicate: (v: T) => boolean) | Find index of the first element that satisfies the predicate |
groupBy(arr: Array<T>, iteratee: (v: T) => any) | Group elements in array based on iteratee |
head(arr: T[]) | Get the first element of an array |
isEmpty(arr: any[]) | Check if array is empty |
isEqual(a: any, b: any) | Check if two values are equal |
isNil(value: T) | Check if value is null or undefined |
isNull(value: any) | Check if value is null |
isUndefined(value: any) | Check if value is undefined |
keys(obj: T) | Get keys of an object |
nth(arr: T[], index: number) | Get the nth element of an array |
random(min: number, max: number) | Generate a random number between min and max |
range(start: number, end: number, step = 1) | Generate an array of numbers between start and end, stepping by step |
sample(arr: T[]) | Pick a random element from an array |
sampleSize(arr: T[], n: number) | Pick n random elements from an array |
shuffle(arr: T[]) | Shuffle an array |
tail(arr: T[]) | Get the last element of an array |
take(arr: T[], n: number) | Take first n elements of an array |
throttle(func: T, wait = 0) | Throttle function calls |
times(n: number, iteratee: (index: number) => T) | Repeat an action n times and collect results |
values(obj: T) | Get values of an object |
without(arr: T[], ...values: T[]) | Remove specified values from an array |
zip(arr1: T[], arr2: U[]) | Zip two arrays together |
zipObject(props: T[], values: U[]) | Create an object from arrays of keys and values |