JSFiddle - React, Tailwind, and code Playground
by Chris Ball
JavaScript
// List sort options
const SORT = Object.freeze({
NAME_ASC: 'A-Z',
NAME_DESC: 'Z-A',
DATE_ASC: '0-9',
DATE_DESC: '9-0'
})
Object.entries(SORT).map( opt => {
console.log({
label: opt[1],
value: opt[0]
})
})