Alex Casajuana Alex Casajuana - 1 year ago 168
Javascript Question

Fuse.js library - Order results alphabetically

I'm using Kiro Risk's

to search a bunch of objects within an array. I don't know exactly how its algorythm works, but I can see that uses a score to sort the result list depending on the word match.

I looked if it had any property for these cases but does not. Fuse.js url:

Someone had been in the same situation and knows a trick, or should be better to get Fuse result and then pass it into another function to sort it alphabetically?

Answer Source

Okey, I just parsed the objects result and pushed to an array. Then I just used the javascript function sort() to sort it alphabetically.

result = result.sort();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download