When comparing arrays, the ramda equals
will return true only if two arrays hold the same values in the same order.
I need a function to check if two arrays hold exactly the same values, but ignore the order in which the values occur.
For now I am doing it this way:
const equalLength = (arr1, arr2) => arr1.length === arr2.length
export const equalIgnoreOrder = (arr1, arr2) =>
equalLength(arr1, arr2) && equalLength(arr1, R.union(arr1, arr2))
but I am wondering if there is a more 'out of the box' solution?