Hi, when exactly package level variable gets initi...
# announcements
d
Hi, when exactly package level variable gets initialized? when it is imported like in python?
looks like it's not even initialized on import. Is it lazy init?
d
I assume that's platform dependant. On the JVM, it will be lazy because it uses static initializers.
In native and js, I don't know.
I would guess the teams of the respective platforms realized that lazy initialization is perhaps the better approach
In the end, all initialization needs to occur after the main function invocation, so I actually am not sure how else it would be done.
JS might be a special bean though