Answers for "sort() function in javascript"

4

javascript sort

homes.sort((a, b) => parseFloat(a.price) - parseFloat(b.price));
Posted by: Guest on March-17-2020
-2

array sorting

/*
  Arrays Methods [Sort]
  - sort(Function [Opt])
  - reverse
*/

let myFriends = [10, "Sayed", "Mohamed", "90", 9000, 100, 20, "10", -20, -10];

console.log(myFriends);
console.log(myFriends.sort().reverse());
Posted by: Guest on July-14-2021

Code answers related to "sort() function in javascript"

Browse Popular Code Answers by Language