Skip to content

Commit

Permalink
FIx typo in example for splitArray
Browse files Browse the repository at this point in the history
  • Loading branch information
giraugh authored Jul 19, 2023
1 parent 17a0fa0 commit 9732e39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/arrays/splitArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @returns the array of groups split as per the `splitFn`
*
* @example
* const groups = splitArrayBy([1, 3, 5, 6, 7, 9, 11], (x) => x % 2 === 0) // [[1, 3, 5], [7, 9, 11]]
* const groups = splitArray([1, 3, 5, 6, 7, 9, 11], (x) => x % 2 === 0) // [[1, 3, 5], [7, 9, 11]]
*/
export const splitArray = <T>(arr: T[], splitFn: (t: T) => boolean): T[][] => {
// Handle special case of empty array
Expand Down

0 comments on commit 9732e39

Please sign in to comment.