Answers for "sort modify array js"

5

sort array of objects javascript

list.sort((a, b) => (a.color > b.color) ? 1 : -1)
Posted by: Guest on July-23-2020
1

sort by ascending javascript

const months = ['March', 'Jan', 'Feb', 'Dec'];
months.sort();
console.log(months);
// expected output: Array ["Dec", "Feb", "Jan", "March"]
Posted by: Guest on October-28-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language