I have an array I need to group them based on size_y;
[
{"col":4,"row":1,"size_x":1,"size_y":4},
{"col":2,"row":2,"size_x":1,"size_y":2},
{"col":1,"row":1,"size_x":3,"size_y":1},
{"col":1,"row":4,"size_x":3,"size_y":1},
{"col":1,"row":5,"size_x":4,"size_y":1}
]
Now, if size_y is 4 I want to group all the rows less than or equal to 4.
[
{"col":4,"row":1,"size_x":1,"size_y":4},
{"col":2,"row":2,"size_x":1,"size_y":2},
{"col":1,"row":1,"size_x":3,"size_y":1},
{"col":1,"row":4,"size_x":3,"size_y":1},
],
[
{"col":1,"row":5,"size_x":4,"size_y":1}
]
thanks in advance.
"size_y"property, which"size_y"value should be evaluated?"size_y"value less than the first element, which is not reflected in the resulting data structure at the updated question, correct?.