The sort
function exists, but it sorts from the smallest to the largest, and I'd like to sort from highest to lowest. Is there any function in javascript for this?
Code with sort
:
var numeros = [200,100,400,900,600,700];
numeros.sort();
for(i = 0 ; i < numeros.length; i++){
$("ul#ul-numeros").append('<li>' + numeros[i] + '</li>');
}
<ul id="ul-numeros">
</ul>