Hi All,
My brain is stuck and I need help.
I'm just going through the JS Fundamentals training and for the life of me, I cannot seem to fully understand when to use a variable keyword (let, const) or the "function" keyword.
I understand what each does, I've gone through the theory 4 times until now but... something's missing.
Can someone help me, please?
I hope I made this clear enough...
Top comments (1)
Are you familiar with the term "hoisting"? I believe that's one thing that would make you choose the function keyword over let or const.
So, when I'm creating a example snippet in codepen I will often put helper functions at the bottom of the script so the reader can have the important bits at the beginning of the script.