Look at this Playground snippet: I can index the const object with an enum instance, as long as the value of the instance is a key in the const object; but I can't index it with a string instance.
I do understand why a string instance can't be used to index the const object, even if the value of the instance is a key in the object, but why using an enum key works?
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.