Below is an example of an enumeration:
export enum Foo {
AA = 0,
ZZ = 1,
AB = 2,
ER = 5
}
In my case, I want to sort my Bars
based on the name of the enum
(AA, AB, ER, ZZ), rather than the numerical value (0, 1, 2, 5) that they represent.
I've been trying to use lodash for sorting, but it doesn't seem to be working as expected:
const orderedBars = _.orderBy(unorderedBars, 'foo');