how to sort an array in javascript in descending order without sort code example
Example: javascript sort descending
function sortEggsInNest(a, b) {
return a > b ? -1 : b > a ? 1 : 0;
}
function sortEggsInNest(a, b) {
return a > b ? -1 : b > a ? 1 : 0;
}