SyntaxFix
Write A Post
Hire A Developer
Questions
The easiest way seems to be subtracting the second number from the first:
var numericArray:Array<number> = [2,3,4,1,5,8,11]; var sorrtedArray:Array<number> = numericArray.sort((n1,n2) => n1 - n2);
https://alligator.io/js/array-sort-numbers/