javascript - use a callback inside a sort function -
i want use callback function when sort method has finished sorting numbers inside array. think must this:
totals.sort(function(a, b){b - a; continuation()});
somehow though, code isn't doing supposed do. therefore wondering wheter or not because of line of code. in case is, can please tell me appropriate way this.
the sort
function doesn't accept argument that, can't.
it isn't needed though: sort
isn't asynchronous in first place.
just sort array, whatever else want afterwards.
totals.sort(function(a, b){b - a; }); continuation()
Comments
Post a Comment