Created
June 6, 2022 07:53
-
-
Save mr-pascal/ea9be81fca72138094307ae4fdba9058 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum MyStringEnum { | |
HELLO = 'HELLO_VALUE', | |
WORLD = 'WORLD_VALUE' | |
} | |
const stringEnumKeys = Object.keys(MyStringEnum); | |
const stringEnumValues = Object.values(MyStringEnum); | |
console.log('Keys:'); | |
// Output: [ 'HELLO', 'WORLD' ] | |
console.log(stringEnumKeys); | |
console.log('Values:'); | |
// Output: [ 'HELLO_VALUE', 'WORLD_VALUE' ] | |
console.log(stringEnumValues); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment