I need to sort a big list of Javascript items and I'm using the sort function like this:
var sorted_list = non_sorted.sort(function(a,b){
// Sort stuff here
});
What I'd like to do is to call a function when the sort function is done.
Is it possible to add a callback function to sort or to trigger an event when when sort is over?
.sort()is synchronous.arr.sort(comparefn).arrMethod()orsomeFn(arr.sort(comparefn))since sort returns the sorted object.