This question born considering the function declarations VS function expressions.
We clearly know that a function declaration have this form
function foo() {
var a = 3;
console.log( a );
}
while a function expression can have this form (appearing like what is known like Immediately invoked function expression)
(function foo() {
var a = 3;
console.log( a );
})()
Looking at the immediately invoked function expression I can just notice the first function (the one used in the function declaration) wrapped in parethesis.
Now, the point is: I know that the grouping operator (most commonly known as "the parethesis" () ) can only contain an expression. If this is true I can't say that the function declaration is also a function statement (because it would be like saying that I have wrapped in parenthesis a statement...).
So, can you give some help, I'm a little confused. A function declaration is also a function statement? If yes, the function wrapped in parenthesis is a statement or what?
I must clarify that I'm not asking about the difference beetwen a function declaration and a function expression. If I mention them and their differences is just to describe my question that is: a "function declaration" is also a "function statement"?