function getData () { };var getData = function() { };var getData = function getData() { };
Unless you want your call stacks to look like: (Anonymous function)…You might want to change your example to: var getData = function getData() { };When you name your function expressions, that name is only used inside that function, so it doesn’t conflict with the getData variable outside the function.
// Don't do this:function getData() { }// Do this instead:var getData = function() { };
a = function callee() { callee.b = 1;};a();alert(a.b); // Vypíše 1