Answers for "order function javascript array"

-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 "order function javascript array"

Browse Popular Code Answers by Language