Thanks for your answers! But, @Old Pedant, I don't really understand what does:
Code:
function sortOnNumeric( a, b )
{
return Number( b.replace(/\D/g,"") ) - Number( a.replace(/\D/g,"") );
}
And I don't want to use .sort...(the execution speed isn't an issue)
Basically, what I'm looking to do is to see if the string I'm about to add has an integer bigger than the first one in the result array. If it does, put it at the beginning of the array; if not, push it at the end. I can't think of any other way to sort an array in descending order without using .sort