Could you please clarify something for me? Below is an example of a function statement:
function foo() {}
However, the following examples are all function expressions.
var foo = function() { } // or
var foo = function foo() { } // or
var foo = new function() { }
My question is, what distinguishes between these two forms of a function expression?
var foo = function() { } // and
var foo = new function() { }
Is the second one also considered a constructor expression? If so, which "class" does it belong to (keeping in mind that JavaScript doesn't have traditional classes but rather templates, functions, or prototypes)?
Update
To those who have shared related questions, I want to express my gratitude. Learning this language has been quite overwhelming for me as a beginner, and while I find it fascinating, it can also be confusing at times. I hope to fully grasp the intricacies of this beautiful language eventually. Please continue suggesting other relevant resources if possible.