I have a data structure that looks like this:
const arrays = {
one: [[1, 33, 41], [2, 0, 27], [3, 7, 9], [4, 1, 3]],
two: [[1, 77, 2], [2, 6, 3], [3, 0, 0], [4, 55, 3]],
three: [[1, 4, 6], [2, 0, 0], [3, 5, 6], [4, 0, 0]],
};
In this structure, the first number in each array is consistent:
1 for the first inner array,
2 for the second inner array,
3 for the third inner array,
and so on.
I am looking to filter these arrays based on the first number and a comparison number (e.g. [3]).
For example, if we use the filter number [3] (less than or equal to 3),
the desired result would be:
const arrays = {
one: [[1,33,41], [2,0,27], [3,7,9]],
two: [[1,77,2], [2,6,3], [3,0,0]],
three: [[1,4,6], [2,0,0], [3,5,6]],
};
This output includes only the inner arrays where the first numbers are less than or equal to 3, while ignoring those starting with higher numbers like 4, 5, and so on. What would be the Ramda approach to achieve this functionality?