What determines if a JavaScript function is a named anonymous function versus a, um, regular function?
问题 Reading "A re-introduction to JavaScript" I noticed something interesting about functions: The name provided to an anonymous function as above is(or at least should be) only available to the function's own scope. Entering some things based on the code in the tutorial at the nodejs prompt I was able to verify that node agrees with the author: function add(foo, bar) { return foo + bar; } add(1, 2); gets me 3, and: var five = (function plus(foo, bar) { return foo + bar; })(2, 3); plus(2, 3);