Doctor 🤖
Doctor 🤖•2y ago

TypeScript enums

So enums are objects with all keys being values and values being keys. Most of the time when using enums though, I place a specific enum, so knowing exactly what the value will be there. Is there a way to instead of referring to the object to get to the value, it just hard codes the value when bundling from ts to js?
4 Replies
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Doctor 🤖
Doctor 🤖•2y ago
It didn’t provide anything new. What I want to do is
enum Direction {
North,
East,
South,
West
}

console.log(Direction.North)
enum Direction {
North,
East,
South,
West
}

console.log(Direction.North)
What I want it to do when bundling to js is
console.log(0)
console.log(0)
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Doctor 🤖
Doctor 🤖•2y ago
Oh my bad. Thanks.