How to sort an array of object of object?

This is my array of object
[{
id:id,
_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.

data.sort(function(a,b){
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")