As suggested by many people, one of the usages of named function expression is for recursively calling itself. However, it seems that in Chrome Console, function expression without a name can still do so.
Edit :
I know this is gonna be stackoverflow, however, I would expect a output like a() is not a function
instead of Uncaught RangeError: Maximum call stack size exceeded(…).
var a = function () {
a();
}
a();
the following function expression with a name should be giving me a Uncaught RangeError: Maximum call stack size exceeded(…).
var a = function a () {
a();
}
a();
Edit 2 : In this link https://developer.mozilla.org/en/docs/web/JavaScript/Reference/Operators/function, it says that "If you want to refer to the current function inside the function body, you need to create a named function expression.". However, it seems to me that the statement is no true, because you can still refer to the current function inside the function body without assigning a function identifier to it
Any thoughts would be appreciated