I would say that it depends of fact what do you planed to achieve with Javascript code:
if you planned to insert external your JS script(s), then the best
place is in head of the page
if you planed to use pages on smartphones, then bottom of page,
just before tag.
but, if you planned to make combination HTML and JS (dynamically
created and populated HTML table, for example) then you must put
it where you need it there.