Anonymous function assigned to variable vs a named function.
Let me explain today about the difference between anonymous function assigned to variable vs a named function. One important difference is how the function is hoisted.
With function foo(), the entire function is hoisted to the top of the surrounding scope. This means that you can call and reference a function before it's declared.
With function foo(), the entire function is hoisted to the top of the surrounding scope. This means that you can call and reference a function before it's declared.