Array Helpers
Utility functions for working with arrays.
Functions
| Function | Description |
|---|---|
arrayEquals | Simple helper that checks if two lists are identical. |
chunk | Chunks an array into smaller arrays of specified size |
deepCompare | Deep comparison of two arrays that only returns true or false. |
difference | Returns the difference between two arrays (items in first array but not in second) |
intersection | Compute the intersection of two arrays, meaning the elements that are present |
oneInCommon | Simple helper that check if two lists shared at least an item in common. |
quickCompare | Quick comparison of two arrays using JSON.stringify. |
sortNumberAscFn | Sort numbers in ascending order |
sortNumberDescFn | Sort numbers in descending order |
sortStringAscFn | Sort strings in ascending order |
sortStringDescFn | Sort strings in descending order |
sortStringAscInsensitiveFn | Sort strings in ascending order (case insensitive) |
createSortByStringFn | Creates a sort function for objects by string property |
createSortByNumberFn | Creates a sort function for objects by number property |
createSortByDateFn | Creates a sort function for objects by date property |
unique | Removes duplicate values from an array |