Almost all JavaScript code should be in separate JavaScript files. There should be the smallest possible amount of JavaScript inline in the HTML code of pages.