One of the advantages of JavaScript putting function declarations into memory before it executes any code segment is that it allows you to use a function before you declare it in your code.
Read next

Test-Driven Development with Nodejs, Express, Mongoose & Jest
Emmanuel Etukudo -

ππManage Work From Home effectively using wfh kit
KaRthick -

I built my Portfolio Website using nothing but HTML & CSS!
Fahad Imran -

Enough JavaScript to get you Started : #2 Evolution of JS
Adarsh Pandya -
Discussion
And is a disadvantage too when you consider variables...
absolutely.