partition([1, 2, 3, 4, 5], x => x % 2 === 0)
// β [[2, 4], [1, 3, 5]]partition<T> splits an array into two groups β those matching a predicate and those that don't.
Challenge: Implement partition<T>(arr: T[], pred: (x: T) => boolean): [T[], T[]] splitting into [matches, nonMatches].
partition([1,2,3,4,5], x => x % 2 === 0) // β [[2,4],[1,3,5]]