I'm calling and binding data using rest api and trying to manage group by functionality using underscore js. But I can't determine how could I do that.
Here is my returned data image:

I'm doing group by on int value that works fine but my expected output is group by 0-1,1-2,2-3 by distance value
suppose array is returning distance 0,0.224,0.50,1.22
then output should be in two array 0: 0,0.224,0.50 and 1: 1.22
Thanks.
If I understand you correctly you should use
in this case you will get the output that you expect. Check the demo: