Skip to content

Conversation

@teijeong
Copy link

Actual values of enums can be accessed by enumsByName of enumsByValue.

Usage:

var value = enumsByName.ENUM_NAME.PROPERTY_NAME.value;
var name = enumsByValue.ENUM_NAME[PROPERTY_VALUE].name;

Specifying .value or .name is to preserve descriptions along with the
value or name in the same key

Actual values of enums can be accessed by enumsByName of enumsByValue.

Usage:

```
var value = enumsByName.ENUM_NAME.PROPERTY_NAME.value;
var name = enumsByValue.ENUM_NAME[PROPERTY_VALUE].name;
```

Specifying .value or .name is to preserve descriptions along with the
value or name in the same key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant