I was told that you must always declare functions in JavaScript. Is that true? What is the advantage of it?
I usually assign functions to a variable as such:
var foo = function() {};
But supposedly this is wrong, something to do stack tracing. Can someone please explain? I was told to do:
var foo = function fooBar() {};
Would it make sense if it's assigned to an object?
var Foo = {};
Foo.Bar = function Bar() {};
Mind you these functions are not inside of the global scope nor self-executed nor used multiple times.