What's the difference between using <script> within the body tag and the head tag? How does it differ in terms of functionality?
there is no big difference. it would be better if we put scripts in the body tag because it will not block html to load the page script. if we put it in head tag, it will delay the html to load the page because it must load the script first.
Page load time on the html. Always place your functions as far down in the page as possible, preferrably load heavy js in the footer :)