Hi, actually, the function is referenced from https://stackoverflow.com/questions/47879864/how-can-i-check... . :(
But I think there are two reasons to write like that:
1. It avoids multiple assignments, which could make codes cleaner.
2. My website is too simple so maybe there is no enough reason to do such "optimization". But if we are talking about a big project, this initialized global variable could make other codes which required to check if the wasm feature enabled easier and just need to calculate the status one time.