How to sort an array of object of object?

This is my array of object
_debit:{category:A, sub_category:big}

How to I sort the array according to _debit.category?
Currently I am sorting using advance javascript and it is not working.

if (a._debit.category===b._debit.category){
return (a._debit.sub_category>b._debit.sub_category);
} else if(a._debit.category>b._debit.category){
return 1;
} else if(a._debit.category<b._debit.category){
return -1;

Hi, you can use the ORDER formula here:

ORDER<item>(<your array here>, item._debit.category, "asc")