In this case, there is no benefit, but if the variable in question is a type of value, then the advantage will be that you can execute some mutating installation code and still get a constant from it.
It also allows you to hide temporary variables that are only needed to initialize the constant, since they will only exist inside the closure area.
source
share