I have a problem with sorting, my results sort correctly and zeros are displayed at the end. But I don't know how to make it sort and display sorted results but without zeros.
var data = [1,6,5,0,9,8,0];
data.sort((a, b) => {
return !a.num - !b.num || a.num - b.num;
})
``
output [1,5,6,8,9,0,0]
I would like the result:
output [1,5,6,8,9]