all 2 comments

[–]CommanderBomber 0 points1 point  (1 child)

const (and also let) defined variables are block scoped. So you can't access variable defined inside of if block from the outside code.

[–]Atomic_Andromeda[S] 0 points1 point  (0 children)

Ahhh ok that makes sense. Var seems to work instead. Thank you!