by dkyc · 12y ago · 0 comments
var MyProject = {};
MyProject.func = function() {}
If you ever want to assign a function to an object, you might as well do it with global-scope functions. Most debuggers/profilers I am aware of can handle this notation well. If they don't, there is still the possibility of doing var Box = function Box (a, b) {}
The function does not have to be anonymous!