Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript sort by big amount to small desc

let numbers = [44, 32, 15, 500]
let lowestToHeight = numbers.sort((a, b) => a - b); //Output: [15,32,44,500]
let highestToLowest = numbers.sort((a, b) => b-a); //Output: [500,44,32,15]
 
PREVIOUS NEXT
Tagged: #javascript #sort #big #amount #small #desc
ADD COMMENT
Topic
Name
1+4 =