I have the following sort function:
var timeArray = new Array(\'11:41\', \'11.39\', \'11:41\', \'11:41\', \'11:40\', \'11:70\', \'11:39\', \'11:38\', \'11:38\',
Change the sort function to
timeArray.sort(function(c, d) {
var digit1 = parseInt(c.replace(/\D/g,''));
var digit2 = parseInt(d.replace(/\D/g,''));
return digit1 - digit2;
});
FIDDLE
It's expecting a number to be returned, not a boolean.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort