EDIT
As comment suggests, Enum is not part of JavaScript but part of TypeScript. I intentionally left original title as one may make mistake like me.
I have two enums with the same keys but different values.
enum RowStates {
editing = 0,
sentToApproval,
approved
// ...
}
enum RowColors {
editing = '#ffffff',
sentToApproval = '#ffffcc',
approved = '#ccffb3'
// ...
}
And I have some function to do convertion:
function Convert (rowState) {
// What should be here to return rowColor?
// Using switch (rowState) is obvious, but may be other solution exist?
}
emunis not a javascript keyword.