re: javascript complaining
@hack in idiomatic JS, typically functions are defined at the top level (often imported from another module) and only ever called from within other functions, with the entrypoint usually being a file which depends on all the others
in this case, the definition order and execution order are effectively decoupled (and necessarily, since module load order is undefined)—all the top-level declarations which define constants will have executed before the main entrypoint executes.
you're right that you can't do, like
```
main();
const main = () => blah();
```
whereas you can with functions. but this would go against best-practices either way. best-practices would be
```
import main from "./main.js";
main();
```
and in that situation definition and execution order are decoupled by nature of the module system
(as for why people use arrow functions now instead of the other ones, that's a different conversation but the short answer is people find them easier to write and conceptually simpler)
re: javascript complaining