var f=function foo()
{
console.log("hello");
};
f();
foo();
This produces an error as : "Exception: ReferenceError: foo is not defined"
But "foo" is defined. Why does this happen?I know that this is a function expression and "f()" is used to access this function. But this is not an anonymous function , I do have a name for this function. Why am I not able to access the function using its name?