Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js order alphabetically

// Alphabetically
const ascending = data.sort((a, b) => a[field].localeCompare(b[field]))
// Descending
const descending = ascending.reverse()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #order #alphabetically
ADD COMMENT
Topic
Name
2+3 =