How do you detect your enum input?

So, I’m making a block that have Enum’s in it, but how do you detect what type of Enum choices do a script

I’m pretty sure it uses a number.

I think the best way is using switch and case like this:

enum GameState {
    Intro,
    Menu,
    Playing,
    Cutscene
}
let gameState = GameState.Intro

game.onUpdate(function () {
    switch(gameState) {
        case GameState.Intro:
            ...
            break
        case GameState.Menu:
            ...
            break
        case GameState.Playing:
            ...
            break
        case GameState.Cutscene:
            ...
            break
    }
})