javascript array splice sort alphabetically code example
Example 1: js order alphabetically
// Alphabetically
const ascending = data.sort((a, b) => a[field].localeCompare(b[field]))
// Descending
const descending = ascending.reverse()
Example 2: js sort asendenet
var points = [40, 100, 1, 5, 25, 10];
points.sort(function(a, b){return a-b});