Can any body throw me some arguments for using inline functions against passing predefined function name to some handler.
I.e. which is better:
I prefer to use named functions. Named functions show by name on all debuggers (air, firebug, IE).
Example:
Notice that you can also have inline named functions like
{
method: function obj_method(){}
}
This way, when you look at the stack trace, you'll see function obj_method instead of anonymous.
Were you asking about when to inline a function rather than declare it? When it makes sense in the code. If you need it from two different places, it can't be inline. Sometimes inline make the code easier to read, sometimes harder.