I would like someone to explain to me if a function expression consists of the function value and the variable it is stored in, or if it only refers to the function value itself. When I see the term "function expression," it typically refers to the entire snippet below:
const funcExp = function(){console.log("Hello World!")};
However, this made me wonder about this syntax:
function(){console.log("Hello World!")}
In my opinion, the function expression is just the function value on its own, essentially making it a pure anonymous function, right? It seems odd to call this an anonymous function:
const funcExp = function(){console.log("Hello World!")};
After all, it already has a name in a way - not directly as part of the function value, but as part of the variable it's assigned to. So, I'm curious to know what really defines a function expression - is it the creation of a variable initialized with a function value, or just the function value itself? If it's the former, then what do we call these types of function values
function(){console.log("Hello World!")}
? Are they also considered function expressions? Thanks for your input.