1๐
โ
My 2 cents on the issue
Performance wise:
If the JS is important for your landing page rendering, inline it as template.
Otherwise I would generally vote for your way (external JS file) maybe using async, and of course putting the link at the end of the page.
But it some cases like small size scripts, the inline approach can make sense.
Source:stackexchange.com