Comment

Comment by el_programmador

The difference is that you've encapsulated your coding logic in mainMethod() instead of writing under that if condition itself. If latter was the case, you can't call that code from another module without resorting to os shell level features.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton