Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

sort array descending

testsSortedByNome = tests.sort((a, b) => (a.nome > b.nome ? -1 : 1));
testsSortedByCognome = tests.sort((a, b) => (a.cognome > b.cognome ? -1 : 1));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sort #array #descending
ADD COMMENT
Topic
Name
8+3 =