The difference between function, var, and let/const.

If you are new to JavaScript, you may see conflicting advice in your learning. There appear to be three different ways to define a function!

The key difference between these methodologies lies in “hoisting,” which takes a variable defined towards the end of a scope and allows…