Is there a simple method to extract only the keys from an enumerator without returning both keys and values? The Object.keys() function returned 6 keys (0-5) when I tried it, likely because iterating through the enum with forEach also retrieved the values. I want a straightforward way to extract just the keys without having to manipulate another list.
I plan to implement this in a React application
My enumerator:
enum ObservationType {
Accomodation = 1,
Addtional = 2,
LandTransport = 3
}
Here is a code snippet that I attempted, which ended up displaying all six values:
{Object.keys(ObservationType).map((type) => <div>{type}</div>)}